Question about halt on opensuse 11.2

Hi.

Little question about the halt (on 11.2)

When I start my computer with a X session, and I type /sbin/halt, the last lines I see before the halt are :
Shutting Down D-Bus Daemon Done.

If I start only a console I have :
Shutting Down D-Bus Daemon Done.
Turning off swap
Umounting file system


The system will be halted immediatly

I am a bit worried by the difference, because I would like to be sure that it stops correctly on a halt command.
Especially I need to be sure that the filesystem are correctly unmounted on the halt command.
This computer will be delivered to customer and I fear some filesystem corruption if the unmount are not correctly done if the boot is done with X.

Any idea ?

Thanks

You should use

shutdown -fh now

instead of halt. It’s the approved way.

Same behaviour with “shutdown -fh now”
Stops with “Shutting Down D-Bus Daemon Done.” in case of X running.

If the filesystems are unmounted and there are no checks when booting up the next time, then everything’s ok, be happy.

But there is a shutdown button on the desktop, why aren’t you using that and going to the CLI?

I already have a crash on the /dev/sda1 (boot partition ) (filesystem corrupted).
So not sure the unmount are correctly done in my case.

Just trying to understant why it doesn’t work as exepected.

Chris

Well it seems that the missing output come from /etc/init.d/halt
In fact the script is executed (so unmount are probably correctly done) but if if called from X, output is not displayed.

After first reading, it appears that this script is quite bogus.
e.g : test “$SPLASH” = yes && /sbin/splash -q

if I execute /sbin.splash -q, it returns “Please supply a config file”
Problably a change in splash and this script was not updated.
I guess it was to close the splasscreen and show instead the console output ?
In fact it just does nothing and I keep the splash screen display.

Then I see:

if test -n “$REDIRECT” && /sbin/checkproc /sbin/blogd ; then
# redirect our famous last messages to default console
exec 0<> $REDIRECT 1>&0 2>&0
fi

In my case I have $REDIRECT==/dev/tty1 but blogd is not running.
So output redirection is not done.

If I comment the test and just keep the redirection I see some peaces of the missing trace.

Well not very important but maybe this script should be updgraded for coming versions (if not already done …)

Chris

blinde wrote:

> Just trying to understant why it doesn’t work as exepected.

my best guess is that it doesn’t work as you expect because you don’t
know what to expect…

i say that because i’ve never met a linux admin who would shutdown
their system with “/sbin/halt” without the -h switch, at least…

i highly recommend you dig into the manual on YOUR machine


man halt

i say on your machine because the man pages there should correctly
reflect the state of ‘halt’ on your machine…

your system is newer than mine, and mine says [in man halt]: "The -h
flag puts all harddisks in standby mode just before halt or poweroff.
Right now this is only implemented for IDE drives. A side effect of
putting the drive in standby mode is that the write cache on the disk
is flushed. This is important for IDE drives, since the kernel doesn’t
flush the write-cache itself before poweroff.

The halt program uses /proc/ide/hd* to find all IDE disk devices,
which means that /proc needs to be mounted when halt or poweroff is
called or the -h switch will do nothing."

you have not stated what kind of disks you are using, are they IDE?
but, in any event if you just type “/sbin/halt” without the -h switch
you are very likely to do file system damage, right?

next i’d say you probably should dig into


man shutdown

and, your “Same behaviour with “shutdown -fh now” Stops with “Shutting
Down D-Bus Daemon Done.” in case of X running.” prompts me to ask: are
you saying it hangs there and doesn’t complete the system shutdown
and full power down?

and please explain why you use X but are not using the shutdown button
in the X GUI…

and, if you don’t want to use the shutdown button in the GUI you
probably should at least log out of X prior to the halt/shutdown by
use of the init command (to get to run level three), and THEN use the
shutdown command Ken gave you, instead of /sbin/halt

guessing that halt will do as you expect is not a good plan when
preparing a machine for a paying customer.


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]

what packages i must to install?..Can someone tell me some of them?
With terminal of course

Hi.

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.

so on 11.2 /sbin/halt in X == shutdown -h…

About the button, I am running XFCE and the behaviour is quiet strange.
The “Log out” & “Shutdown” lead both to the login windows of XDM

Anyway, I think that, if you have read my last post, you will agree that the issue is related with /etc/init.d/halt.
I think I will patch this file for my needs.
However, I think it should be patched if 11.3 and incoming version if not already done.

Regards

Chris

“are you saying it hangs there and doesn’t complete the system shutdown
and full power down?”

Well, my board is an embedded board, and can not turn off the power automatically.
So it’s why it is hard for me to know if halt has ended correctly if some traces are missing.

about the init 3, it works.
If I made /sbin/init 3 it goes back to a login shell
If I log and make a halt, it works fine.

Thanks for your help and quick replies.

blinde wrote:
> I think I will patch this file for my needs.
> However, I think it should be patched if 11.3 and incoming version if
> not already done.

please log your bug or it will not be addressed…raising the issue
here will NOT put it into the developers hands (they are not here, and
if they were this forum is not used to collect either bugs or good
ideas), please visit: http://en.opensuse.org/Submitting_Bug_Reports


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]