Re: Single user mode exits unexpectedly

2012-01-01 Thread Janos Dohanics
On Sat, 31 Dec 2011 09:39:41 +0100
Polytropon  wrote:

> On Sat, 31 Dec 2011 00:57:04 -0500, Janos Dohanics wrote:
> > I have just rebuilt world and kernel according to the Handbook,
> > installed the new kernel, rebooted, logged in, issued "sudo shutdown
> > now" - the machine entered single user mode, then immediately exited
> > without any intervention by me and continued to boot into multiuser
> > mode.
> 
> That's not the procedure required. From the comment section
> of /usr/src/Makefile:
> 
>  1.  `cd /usr/src'   (or to the directory containing your source
> tree).
>  2.  `make buildworld'
>  3.  `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is
> GENERIC).
>  4.  `make installkernel KERNCONF=YOUR_KERNEL_HERE'   (default is
> GENERIC). [steps 3. & 4. can be combined by using the "kernel" target]
>  5.  `reboot'(in single user mode: boot -s from the loader
> prompt).
>  6.  `mergemaster -p'
>  7.  `make installworld'
>  8.  `make delete-old'
>  9.  `mergemaster'(you may wish to use -i, along with -U
> or -F).
> 10.  `reboot'
> 11.  `make delete-old-libs' (in case no 3rd party program uses them
> anymore)
> 
> Step 5: reboot _into_ single user mode. After installing
> the kernel and shutting down the system, let it come up
> to the kernel loader. You can enter that stage by pressing
> the space bar several times. If I remember correctly,
> you'll then see prompt

Well, rebuilt World, kernel, installed kernel, rebooted into single
user mode, installed world, but still have the same problem. When going
from multi user mode to single user mode: the computer immediately exits
single user mode and boots into multi user mode. When starting the
system and booting into single user mode, this does not happen.

I'd appreciate your suggestions...

-- 
Janos Dohanics
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Single user mode exits unexpectedly

2011-12-31 Thread Janos Dohanics
On Sat, 31 Dec 2011 09:39:41 +0100
Polytropon  wrote:

> On Sat, 31 Dec 2011 00:57:04 -0500, Janos Dohanics wrote:
> > I have just rebuilt world and kernel according to the Handbook,
> > installed the new kernel, rebooted, logged in, issued "sudo shutdown
> > now" - the machine entered single user mode, then immediately exited
> > without any intervention by me and continued to boot into multiuser
> > mode.
> 
> That's not the procedure required. From the comment section
> of /usr/src/Makefile:
> 
>  1.  `cd /usr/src'   (or to the directory containing your source
> tree).
>  2.  `make buildworld'
>  3.  `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is
> GENERIC).
>  4.  `make installkernel KERNCONF=YOUR_KERNEL_HERE'   (default is
> GENERIC). [steps 3. & 4. can be combined by using the "kernel" target]
>  5.  `reboot'(in single user mode: boot -s from the loader
> prompt).
>  6.  `mergemaster -p'
>  7.  `make installworld'
>  8.  `make delete-old'
>  9.  `mergemaster'(you may wish to use -i, along with -U
> or -F).
> 10.  `reboot'
> 11.  `make delete-old-libs' (in case no 3rd party program uses them
> anymore)
> 
> Step 5: reboot _into_ single user mode. After installing
> the kernel and shutting down the system, let it come up
> to the kernel loader. You can enter that stage by pressing
> the space bar several times. If I remember correctly,
> you'll then see prompt

You are right, the Handbook says "Reboot into single user mode", and I
should have just followed it. Nonetheless, I used to reboot normally,
and then drop in single user mode - can't remember ever seeing this
problem.

Thank you, I'll try it next time I'm at that machine...

-- 
Janos Dohanics
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Single user mode exits unexpectedly

2011-12-31 Thread Polytropon
On Sat, 31 Dec 2011 00:57:04 -0500, Janos Dohanics wrote:
> I have just rebuilt world and kernel according to the Handbook,
> installed the new kernel, rebooted, logged in, issued "sudo shutdown
> now" - the machine entered single user mode, then immediately exited
> without any intervention by me and continued to boot into multiuser
> mode.

That's not the procedure required. From the comment section
of /usr/src/Makefile:

 1.  `cd /usr/src'   (or to the directory containing your source tree).
 2.  `make buildworld'
 3.  `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
 4.  `make installkernel KERNCONF=YOUR_KERNEL_HERE'   (default is GENERIC).
  [steps 3. & 4. can be combined by using the "kernel" target]
 5.  `reboot'(in single user mode: boot -s from the loader prompt).
 6.  `mergemaster -p'
 7.  `make installworld'
 8.  `make delete-old'
 9.  `mergemaster'(you may wish to use -i, along with -U or -F).
10.  `reboot'
11.  `make delete-old-libs' (in case no 3rd party program uses them anymore)

Step 5: reboot _into_ single user mode. After installing
the kernel and shutting down the system, let it come up
to the kernel loader. You can enter that stage by pressing
the space bar several times. If I remember correctly,
you'll then see prompt

Ok
> _

Then enter "boot -s" to bring up the system in single user
mode. After you've confirmed the shell, do

# mount -a
# cd /usr/src
# mergemaster -p

and continue with steps 7 - 10.

If you have the Beastie menu, press [4] to get into the
single user mode.



> Here is a snippet from /var/log/messages:
> 
> Dec 30 17:41:15 iguana rc.shutdown: 30 second watchdog timeout expired. 
> Shutdown terminated.
> Dec 30 17:41:15 iguana init: /bin/sh on /etc/rc.shutdown terminated 
> abnormally, going to single user mode
> Dec 30 17:41:15 iguana syslogd: exiting on signal 15<---
> Dec 30 17:41:28 iguana syslogd: kernel boot file is /boot/kernel/kernel <---
> 
> This seems to be happening every time in response to "shutdown now".

The reason might be that you're running your updated
kernel, but the world has not been properly installed?



> However, I can cold boot this machine into single user mode with
> nothing unusual.
> 
> This is FreeBSD 8.2-STABLE amd64, rebuilt on 12/26/2011
> 
> I guess I may have unintentionally changed a config file? Where should
> I look?

Review your installation steps and _maybe_ redo the installation
as indicated in the manual. Maybe there's really just something
out of sync.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Single user mode: no shell prompt

2010-10-27 Thread Martin Schweizer

Hello Illoai

Am 27.10.2010 18:14, schrieb ill...@gmail.com:

On 20 October 2010 03:50, Martin Schweizer  wrote:

Hello

If I start the server in single user mode I get never a prompt/shell (at the 
console). After successfully boot in single user mode I see a the last line:
"Trying to mount root from ufs:/dev/mfid0s1a". The only thing I can do is 
CTRL-ALT-DEL, then the system reboots as usual (with no broken file system).
All works well in multi user mode. I have no other problems with this server.


On at least one of my machines the USB devices do not
finish probing until after the "Enter the name of your shell
or press enter for /bin/sh" prompt, and thus it scrolls off
of the screen.  Pressing enter does give me a /bin/sh in
single-user mode, however.


Yeah, I now what you mean but in the mean team I found the solution. The 
problem was the console redirection. Why ever...


Regards,

--
Martin Schweizer

PC-Service M. Schweizer GmbH; Bannholzstrasse 6; Postfach 132;
CH-8608 Bubikon; Tel. +41 55 243 30 00; Fax: +41 55 243 33 22

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Single User Mode

2006-01-27 Thread Jerry McAllister
Hello,

The following sounds like you are having a LINUX problem.
Threfore, you should post on the relevent LINUX Email list.

This is a FreeBSD questions list.   
FreeBSD is not related to LINUX.
It is a completely separate operating system.

Now, if you wish to upgrade your environment to FreeBSD
then this list will probably be a good resource for help
if you need it - although, the installation of FreeBSD is
straightforward enough and well enough documented that you
might not need it.

jerry

> Hi guys
> This is anirban here.Our offices linux server is connected in a network .I
> have deleted the pango rpm pango 1.8.1-2 while working on it but i dont
> delete the depencies of pango. I used the command
> rpm -e pango --nodeps.
> But after that i cant login in the machine and whenever i am tryong to login
> as a root user it is showing that root login are not allowed.Then i download
> the exact prm from internet and login in the single user mode on the damaged
> machine but i am not able to do ftp operation.
> Now i have two question
> 1) In single user mode is it possible to access resources from the network.
> 2) How to install this rpm . My machine doesnt have a floppy drive.
> 
> I dont want to reinstall the os .I use FC4.
> 
> With regards
> Anirban.
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
> 
> 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Single User Mode

2006-01-27 Thread Matthew Seaman
Anirban Adhikary wrote:

> This is anirban here.Our offices linux server is connected in a network .I
> have deleted the pango rpm pango 1.8.1-2 while working on it but i dont
> delete the depencies of pango. I used the command
> rpm -e pango --nodeps.
> But after that i cant login in the machine and whenever i am tryong to login
> as a root user it is showing that root login are not allowed.Then i download
> the exact prm from internet and login in the single user mode on the damaged
> machine but i am not able to do ftp operation.
> Now i have two question
> 1) In single user mode is it possible to access resources from the network.
> 2) How to install this rpm . My machine doesnt have a floppy drive.
> 
> I dont want to reinstall the os .I use FC4.

If you need support for a Fedora Core server, then it would be appropriate
to ask for it on a forum dedicated to that OS.  This is a FreeBSD list.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   Flat 3
  7 Priory Courtyard
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
  Kent, CT11 9PW, UK



signature.asc
Description: OpenPGP digital signature


Re: SIngle User Mode Help

2004-03-06 Thread Gary W. Swearingen
Jerry McAllister <[EMAIL PROTECTED]> writes:

> Learn vi for use in such circumstances or maybe ee.  You don't want to

The editors/e3 port is a nice one for /bin as it has vi and emacs (and
more) flavors in only 12840 bytes, amazingly.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


RE: SIngle User Mode Help

2004-03-05 Thread Joe Pokupec
Thanks for the many posts guys. I understand the concept of mounting the
/usr partition. Actually, the "mount -a" worked even though the fstab was
mucked up. I didn't realize that single user mode doesn't mount the slices
by default... but it all makes sense now.

Thanks

Joe

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jerry McAllister
Sent: Friday, March 05, 2004 7:55 AM
To: Joshua Lokken
Cc: [EMAIL PROTECTED]
Subject: Re: SIngle User Mode Help

> 
> * Jerry McAllister <[EMAIL PROTECTED]> [2004-03-06 02:42]:
> > > 
> > > Hey Guys,
> > > 
> > > I'm constantly botching up my fstab file and the system will fail to
boot
> > > correctly. I've learned to create a working fstab and call is
fstab.orig
> > > which I can overwrite the botched file if I end up in Single User
Mode...
> > 
> > You're right to make a copy before tinkering.
> > 
> > > I can't find any info on Single User Mode to help me:
> > > 
> > > - I use mount -u / to mount the filesystem as read/write
> > 
> > That is correct, but, of course, it only gets the root (/) filesystem
> > mounted.   You may need stuff on other ones, especially /usr.
> > 
> > Try doing 
> >fsck /usr or   fsck  /dev/d0s1f 
> >mount /usror   mount /dev/d0s1f /usr   or whatever slice and
> >   partition you have /usr on
> > 
> > > - I cannot access any editors like vi or pico (my personal) favorite
once in
> > > single user mode... Why?
> > 
> 
> Or, to make things easier:
> 
> prompt# fsck -p

Except this might not work if he has bollixed up his fstab as indicated
in the original question.

> prompt# mount -u /
> prompt# mount -a -tufs

This might not wokr either with a bad fstab.

but doing it for specific devices to specific mount points should work
even with a messed up fstab.

jerry

> 
> just like pre-buildworld...
> 
> -- 
> Joshua
> 
> Another war ... must it always be so?  How many comrades have we lost
> in this way? ...  Obedience.  Duty.  Death, and more death ...
>   -- Romulan Commander, "Balance of Terror", stardate 1709.2
> ___
> [EMAIL PROTECTED] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
"[EMAIL PROTECTED]"
> 

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: SIngle User Mode Help

2004-03-05 Thread Joshua Lokken
* Jerry McAllister <[EMAIL PROTECTED]> [2004-03-06 06:00]:
> > 
> > > > Hey Guys,
> > > > 
> > > > I'm constantly botching up my fstab file and the system will fail to boot
> > > You're right to make a copy before tinkering.
> > > 
> > > That is correct, but, of course, it only gets the root (/) filesystem
> > > mounted.   You may need stuff on other ones, especially /usr.
> > > 
> > > Try doing 
> > >fsck /usr or   fsck  /dev/d0s1f 
> > >mount /usror   mount /dev/d0s1f /usr   or whatever slice and
> > >   partition you have /usr on
> > > 
> > 
> > Or, to make things easier:
> > 
> > prompt# fsck -p
> 
> Except this might not work if he has bollixed up his fstab as indicated
> in the original question.
> 
> > prompt# mount -u /
> > prompt# mount -a -tufs
> 
> This might not wokr either with a bad fstab.
> 
> but doing it for specific devices to specific mount points should work
> even with a messed up fstab.
> 
> jerry

Oh, yeah!  Good point ;)

-- 
Joshua

Is not that the nature of men and women -- that the pleasure is in the
learning of each other?
-- Natira, the High Priestess of Yonada, "For the World is
   Hollow and I Have Touched the Sky", stardate 5476.3.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: SIngle User Mode Help

2004-03-05 Thread Jerry McAllister
> 
> * Jerry McAllister <[EMAIL PROTECTED]> [2004-03-06 02:42]:
> > > 
> > > Hey Guys,
> > > 
> > > I'm constantly botching up my fstab file and the system will fail to boot
> > > correctly. I've learned to create a working fstab and call is fstab.orig
> > > which I can overwrite the botched file if I end up in Single User Mode...
> > 
> > You're right to make a copy before tinkering.
> > 
> > > I can't find any info on Single User Mode to help me:
> > > 
> > > - I use mount -u / to mount the filesystem as read/write
> > 
> > That is correct, but, of course, it only gets the root (/) filesystem
> > mounted.   You may need stuff on other ones, especially /usr.
> > 
> > Try doing 
> >fsck /usr or   fsck  /dev/d0s1f 
> >mount /usror   mount /dev/d0s1f /usr   or whatever slice and
> >   partition you have /usr on
> > 
> > > - I cannot access any editors like vi or pico (my personal) favorite once in
> > > single user mode... Why?
> > 
> 
> Or, to make things easier:
> 
> prompt# fsck -p

Except this might not work if he has bollixed up his fstab as indicated
in the original question.

> prompt# mount -u /
> prompt# mount -a -tufs

This might not wokr either with a bad fstab.

but doing it for specific devices to specific mount points should work
even with a messed up fstab.

jerry

> 
> just like pre-buildworld...
> 
> -- 
> Joshua
> 
> Another war ... must it always be so?  How many comrades have we lost
> in this way? ...  Obedience.  Duty.  Death, and more death ...
>   -- Romulan Commander, "Balance of Terror", stardate 1709.2
> ___
> [EMAIL PROTECTED] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
> 

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: SIngle User Mode Help

2004-03-05 Thread Joshua Lokken
* Jerry McAllister <[EMAIL PROTECTED]> [2004-03-06 02:42]:
> > 
> > Hey Guys,
> > 
> > I'm constantly botching up my fstab file and the system will fail to boot
> > correctly. I've learned to create a working fstab and call is fstab.orig
> > which I can overwrite the botched file if I end up in Single User Mode...
> 
> You're right to make a copy before tinkering.
> 
> > I can't find any info on Single User Mode to help me:
> > 
> > - I use mount -u / to mount the filesystem as read/write
> 
> That is correct, but, of course, it only gets the root (/) filesystem
> mounted.   You may need stuff on other ones, especially /usr.
> 
> Try doing 
>fsck /usr
>mount /usror   mount /dev/d0s1f /usr   or whatever slice and
>   partition you have /usr on
> 
> > - I cannot access any editors like vi or pico (my personal) favorite once in
> > single user mode... Why?
> 

Or, to make things easier:

prompt# fsck -p
prompt# mount -u /
prompt# mount -a -tufs

just like pre-buildworld...

-- 
Joshua

Another war ... must it always be so?  How many comrades have we lost
in this way? ...  Obedience.  Duty.  Death, and more death ...
-- Romulan Commander, "Balance of Terror", stardate 1709.2
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: SIngle User Mode Help

2004-03-05 Thread Jerry McAllister
> 
> Hey Guys,
> 
> I'm constantly botching up my fstab file and the system will fail to boot
> correctly. I've learned to create a working fstab and call is fstab.orig
> which I can overwrite the botched file if I end up in Single User Mode...

You're right to make a copy before tinkering.

> I can't find any info on Single User Mode to help me:
> 
> - I use mount -u / to mount the filesystem as read/write

That is correct, but, of course, it only gets the root (/) filesystem
mounted.   You may need stuff on other ones, especially /usr.

Try doing 
   fsck /usr
   mount /usror   mount /dev/d0s1f /usr   or whatever slice and
  partition you have /usr on

> - I cannot access any editors like vi or pico (my personal) favorite once in
> single user mode... Why?

Probably they are in the /usr file system.   I usually put a copy of vi
in /bin  which should stay in root and not be farmed out somewhere.
Then I can get at it when things are all bollixed up.

> - I can't use the locate command, because the /usr/libexec/locate.updatedb
> script is not accessible

Also, it is /usr which isn't mounted.

> - I can't su because this is not a recognized command

That is also in /usr, but you don't need it because in single user mode
you are already root.

> Can anyone shed any light on how I can actually edit (preferably using pico)
> my fstab file once I'm in "botch" mode?

Learn vi for use in such circumstances or maybe ee.  You don't want to
have to depend on having one of those bloatware editors working when
you have problems in single user.

Light's above,

jerry

> 
> Thanks
> 
> Joe
> 
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: SIngle User Mode Help

2004-03-05 Thread Greg 'groggy' Lehey
On Thursday,  4 March 2004 at 23:48:05 -0900, Joe Pokupec wrote:
> Hey Guys,
>
> I'm constantly botching up my fstab file and the system will fail to boot
> correctly. I've learned to create a working fstab and call is fstab.orig
> which I can overwrite the botched file if I end up in Single User Mode...
>
> I can't find any info on Single User Mode to help me:
>
> - I use mount -u / to mount the filesystem as read/write
>
> - I cannot access any editors like vi or pico (my personal) favorite once in
> single user mode... Why?

Probably because the file system on which they're located hasn't been
mounted.  Try:

  # mount /usr

> - I can't use the locate command, because the /usr/libexec/locate.updatedb
> script is not accessible

Same thing.

> - I can't su because this is not a recognized command

In single user mode you should be root.

Greg
--
When replying to this message, please copy the original recipients.
If you don't, I may ignore the reply or reply to the original recipients.
For more information, see http://www.lemis.com/questions.html
Note: I discard all HTML mail unseen.
Finger [EMAIL PROTECTED] for PGP public key.
See complete headers for address and phone numbers.


pgp0.pgp
Description: PGP signature


Re: Single user mode, non writeable /tmp

2003-12-15 Thread Lowell Gilbert
Joachim Dagerot <[EMAIL PROTECTED]> writes:

> I just posted a problem regarding vinum where this question was
> hidden:
> 
> 
> My system starts with an error:
> 
> "init: /bin/sh on /etc/rc terminated abnormally, going to single user
> mode"
> 
> This is because a disk has broken down. But my question is what tasks
> do I need to take to be able to run the system. The crashed disk
> contained /home and /usr.
> 
> I can't even edit the fstab because the /tmp disk is not writeable.

This can be solved using the same technique as the FAQ 
"I made a mistake in rc.conf, or another startup file, and now I
cannot edit it because the filesystem is read-only. What should I do?":
 http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/admin.html#RCCONF-READONLY
-- 
Lowell Gilbert, embedded/networking software engineer, Boston area: 
resume/CV at http://be-well.ilk.org:8088/~lowell/resume/
username/password "public"
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: single-user mode

2003-12-04 Thread Kent Stewart
On Thursday 04 December 2003 08:41 am, Dru wrote:
> It's been a while since I've had to enter single-user mode and I've just
> discovered that "boot -s" doesn't work at the "boot" prompt on 5.1-RELEASE.
> (however, it does work nicely if I interrupt loader at the next boot
> stage).
>
> In fact, I can't get *anything* to work at the "boot" prompt, or even
> leave that prompt without doing a CTRL ALT DEL. Am I missing something, or
> is the "boot" prompt defunct on 5.x?
>
>

No, but you have to wait for the spinner (|/-\ and etc) before you press the 
space bar. I just tried it as I updated to the latest 5.2-beta.

Kent

-- 
Kent Stewart
Richland, WA

http://users.owt.com/kstewart/index.html

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: single user mode

2003-03-01 Thread taxman
On Friday 28 February 2003 12:57 pm, Mike Meyer wrote:
> Since nobody else stepped forward with an answer, I'll try
>
> In <[EMAIL PROTECTED]>, Cliff Sarginson 
<[EMAIL PROTECTED]> typed:
> > No I can think of kludgy ways to do this, but I want to know the way
> > it should be done. How can you tell from with a shell script whether you
> > are in single-user mode or not ?
>
> The difference between starting single-user and starting multi-user is
> that init just starts a shell in one case, and in the other it runs
> /etc/rc then deals with /etc/ttys. Shutting down to single-user shuts
> down the things in /etc/ttys - and anything else - then launches a
> shell.  There doesn't appear to be a way to ask init if it's running
> in single-user or multi-user mode.
>
> I'd say the best way is to look for a shell process with a ppid of
> 1. This can be fooled by having a shell started in /etc/ttys. Looking
> for things to be running in multi-user mode depends on them running,
> which may fail during (ab)normal system operation.
>
>
> Might I suggest that you're not really worried about being
> single-user, but instead worried about some condition that is usually
> true in single-user mode (quiescent file systems, no network daemons,
> etc)? If that's the case, you'd probably be better off checking that
> condition than checking for single-user mode. After all, given any
> assumption you make about single-user mode, I can violate that
> assumption if I really want to.

Mike, good points.  I don't think there is an elegant way of doing it either. 
To that end I don't think there is a truly important distinction anyway. If 
you're just looking for the simple answer, Cliff, checking if you can switch 
to another virtual terminal, and looking at the output of ps and perhaps 
mount, should tell you which one you're in.  Presuming you get use to the 
output of those commands in both scenarios.

Tim

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message


Re: single user mode

2003-02-28 Thread Mike Meyer
Since nobody else stepped forward with an answer, I'll try

In <[EMAIL PROTECTED]>, Cliff Sarginson <[EMAIL PROTECTED]> typed:
> No I can think of kludgy ways to do this, but I want to know the way
> it should be done. How can you tell from with a shell script whether you
> are in single-user mode or not ?

The difference between starting single-user and starting multi-user is
that init just starts a shell in one case, and in the other it runs
/etc/rc then deals with /etc/ttys. Shutting down to single-user shuts
down the things in /etc/ttys - and anything else - then launches a
shell.  There doesn't appear to be a way to ask init if it's running
in single-user or multi-user mode.

I'd say the best way is to look for a shell process with a ppid of
1. This can be fooled by having a shell started in /etc/ttys. Looking
for things to be running in multi-user mode depends on them running,
which may fail during (ab)normal system operation.


Might I suggest that you're not really worried about being
single-user, but instead worried about some condition that is usually
true in single-user mode (quiescent file systems, no network daemons,
etc)? If that's the case, you'd probably be better off checking that
condition than checking for single-user mode. After all, given any
assumption you make about single-user mode, I can violate that
assumption if I really want to.

  http://www.mired.org/consulting.html
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message