Re: [opensuse] Reboot via SSH



On 10/08/11 02:01, Brian K. White wrote:
On 8/9/2011 3:04 AM, Carl Hartung wrote:
On Tue, 9 Aug 2011 00:30:34 -0600
Carlos Frederico Lange<carlosflange@xxxxxxxxx> wrote:

On Mon, Aug 8, 2011 at 6:19 PM, Marc Chamberlin
<marc@xxxxxxxxxxxxxxxxxx> wrote:
I ssh'd into my home system as root without any problems. But when
I give the command to reboot, nothing happens.. "shutdown -r now"
also just gives a response saying the system is going down, but
again it does not actually reboot!

Just tested from my desktop to my laptop and the command "reboot"
works fine. Have you looked at the log files? "/var/log/messages" for
example. To see which log files were written most recently run "ls
-lrt".


Interesting ...

On my 11.4 system "reboot" is symlinked to /sbin/halt:

linux:/sbin # ls -al reboot
lrwxrwxrwx 1 root root 4 Jul 13 04:38 reboot -> halt

In any case, I learned several years ago with SuSE to use the init
system for ad hoc run level selections because it is tightly integrated
into the distribution. For example, 'init 0' gracefully brings the
system down and powers it off. 'init 6' does the same thing except the
system is restarted (will boot to the default run level.) 'init 1'
boots/drops to single user mode for certain maintenance items. 'init 2'
gives you multiuser mode without networking. I'm sure you're already
familiar with 'init 3' (run level 3) and 'init 5' (run level 5)

I only ever use "shutdown", ie, "shutdown -r now" and don't have any problem. I believe that is the defined "most correct, most graceful" way in the manual even though several others should usually work well enough. This is true for most os's although the syntax of the command itself changes from os to os.

Recently I noticed an employee had been using "reboot", which I never use because on SCO Unix "halt" and "reboot" are lower level and not very graceful, but it seems to be ok on Suse. You're not even supposed to call init directly on sco, technically you're supposed to use "telinit", when for whatever reason you're not using "shutdown" like you're really supposed to. And the meanings of runlevels aren't necessarily written in stone either. They're written in /etc/inittab which anyone may edit. "init 6" could theoretically not actually mean reboot, but "shutdown -r" always will. Definitely the meaning of "Full multi-user, with networking, without X" is different between some os's. It's init 3 for linux but init 2 for sco unix.

Has noone read the manpages?

man halt:

" If halt or reboot is called when the system is not in runlevel 0 or 6, in other words when it's running normally, shutdown will be invoked instead
(with the -h or -r flag). For more info see the shutdown(8) manpage.
"

and furthermore:

man shutdown:
"
shutdown does its job by signalling the init process, asking it to change the runlevel. Runlevel 0 is used to halt the system, runlevel 6 is used to
reboot the system, and runlevel 1 is used to put to system into a state where administrative tasks can be performed; this is the default if neither
the -h or -r flag is given to shutdown.
"

So everyone arguing about the best way to shutdown/reboot is actually doing the EXACT SAME THING.

Regards,
Tejas
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • [patch] halt/reboot/shutdown cleanup
    ... There is duplication of code between sbin/reboot and init: ... the normal forms of halt and reboot will now call shutdown so ... Halt and reboot still support the -q option to invoke rebootwithout ...
    (freebsd-arch)
  • Re: Reboot Vs Init 0/5/6 Vs Shutdown Vs Halt
    ... Like when and why should we use reboot ... haltbrings down the machine to the PROM immediately, ... shutdown, prints warnings to users logged in (and possibly to any NFS ... init then does things like ...
    (comp.unix.solaris)
  • Re: [opensuse] Cannot shut down
    ... I can't shutdown using either: ... I have to reboot from ... I'll try using "init 3" to check it out. ... If you don't get command prompt after "init 3" than press Enter it should ...
    (SuSE)
  • Re: Hangs in parts.rc
    ... > The secon thin here is that it appears that the system is set to init 6 before ... I have understood that runlevels are modes of operation, and the reboot ... I think it is running in runlevel 5 when I break execution with ctrl-c, ... then I do a ctrl-alt-del and it switches to runlevel 6, ...
    (alt.linux)
  • Re: Hangs in parts.rc
    ... > The secon thin here is that it appears that the system is set to init 6 before ... I have understood that runlevels are modes of operation, and the reboot ... I think it is running in runlevel 5 when I break execution with ctrl-c, ... then I do a ctrl-alt-del and it switches to runlevel 6, ...
    (alt.os.linux)