Your message dated Fri, 24 Jul 2009 20:06:06 +0200
with message-id <[email protected]>
and subject line Re: sysvinit: Running 'halt' twice within one second results
in system not halting
has caused the Debian Bug report #148819,
regarding sysvinit: Running 'halt' twice within one second results in system
not halting
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
148819: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=148819
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: sysvinit
Version: 2.84-3
I found a rather weird bug in sysvinit, or so it seems. When just playing
around with my system I ran 'halt' twice, very fast (<1 second in between)
after each other. The following happens and is reproducable on my system:
Run halt on tty2:
----
odysseus:~# halt
Broadcast message from root (tty2) (Sun Jun 2 17:03:54 2002):
The system is going down for system halt NOW!
INIT: Switching to runlevel: 0
INIT: Sending processes the TERM signal
odysseus:~#
----
Do the same on tty1:
----
odysseus:~# halt
Broadcast message from root (tty2) (Sun Jun 2 17:03:54 2002):
The system is going down for system halt NOW!
----
Note that it mentions tty2 as the sender. There's no such message from tty1!
I get this line almost immediately on tty1 after the second run of 'halt':
----
System halted.
----
Followed by the following line a few seconds later:
----
odysseus:~#
Message from sysl...@odysseus at Sun Jun 2 17:03:57 2002 ...
odysseus kernel: System halted.
----
Well, sounds good. But the system hasn't been halted. Running 'ps aux' returns
this:
----
odysseus:~# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 5.2 0.1 1276 496 ? S 17:02 0:04 init
root 2 0.0 0.0 0 0 ? RW 17:02 0:00 [keventd]
root 3 0.0 0.0 0 0 ? SW 17:02 0:00 [kapm-idled]
root 4 0.0 0.0 0 0 ? SWN 17:02 0:00
[ksoftirqd_CPU0]
root 5 0.0 0.0 0 0 ? SW 17:02 0:00 [kswapd]
root 6 0.0 0.0 0 0 ? SW 17:02 0:00 [bdflush]
root 7 0.0 0.0 0 0 ? SW 17:02 0:00 [kupdated]
root 8 0.0 0.0 0 0 ? SW 17:02 0:00 [khubd]
root 167 0.2 0.3 2488 1304 ? S 17:03 0:00
/usr/sbin/powertweakd
root 176 0.1 0.2 2040 796 ? S 17:03 0:00 /sbin/syslogd
root 180 0.1 0.2 1860 1072 ? S 17:03 0:00 /sbin/klogd
root 186 0.0 0.1 1268 488 ? S 17:03 0:00 /usr/sbin/apmd
-P /etc/apm/apmd_proxy
root 198 0.0 0.1 1552 560 ? S 17:03 0:00 /usr/sbin/gpm
-m /dev/psaux -t ps2
root 211 0.0 0.1 1988 700 ? S 17:03 0:00 /usr/sbin/inetd
root 219 0.0 0.2 1876 788 ? S 17:03 0:00 /usr/sbin/klisa
-c /etc/kde2/lisarc
root 230 0.0 0.2 2716 1144 ? S 17:03 0:00 /usr/sbin/sshd
root 234 2.0 1.5 6940 5796 ? S 17:03 0:01
/usr/bin/X11/xfs -daemon
nobody 238 0.2 4.3 18552 16924 ? S 17:03 0:00
/usr/bin/X11/xfs-xtt -daemon -user nobody -port 7110
root 242 0.0 0.2 1972 800 ? S 17:03 0:00
/usr/X11R6/bin/xfstt --port 7101 --daemon --user nobody
root 254 0.0 0.3 2912 1392 ? S 17:03 0:00
/usr/sbin/apache
root 257 90.5 0.0 680 376 ? RN 17:03 0:46
/home/odysseus/dnet/dnetc
www-data 316 0.0 0.3 2924 1388 ? S 17:03 0:00
/usr/sbin/apache
root 368 0.0 0.1 2516 708 ? S 17:03 0:00 /usr/bin/kdm
root 372 0.0 0.3 2224 1252 tty1 S 17:03 0:00 -bash
root 373 0.1 0.3 2220 1248 tty2 S 17:03 0:00 -bash
root 402 0.0 0.3 3480 1500 tty1 R 17:04 0:00 ps aux
odysseus:~#
----
Init takes 5.2% of the CPU, but that might just be bad luck when I ran ps.
Note that the getty-processes normally running on tty5 and the like are gone,
so init has apparently recieved some signal that it should indeed shut down.
The runlevel-command shows that, too:
----
odysseus:~# runlevel
2 0
----
So I'm running in runlevel 0? Wow, that must be a violation of the
SysV-standard :).
I tried to really halt my system this time, by just running a single 'halt':
----
odysseus:~# halt
System halted.
odysseus:~#
----
That's all. No signs of a real halt, reboot or anything else...tricks like
'init 0' and 'shutdown' don't work either. I guess this has something to do
with init thinking it's in runlevel 0 already. The only way I know of to
solve this is using SysRq: Alt+SysRq+{s,u,b} syncs my devices, umounts them
and reboots.
As said, this problem can easily be reproduced by running 'halt' two times
within the same second or so. I've been able to do this for months at the
least, so it doesn't seem to be a mixup of some particular packages/versions.
One can probably get the same problem when scheduling two shutdowns with cron
at exactly the same time, though I haven't tested that. Is this a race
condition or is there something else going on? I found one bugreport that
mentions that 'halt' does not really halt, but I don't think these problems
are related.
Thanks in advance,
Jonathan Brugge
P.S.: Don't ask me why one would want to run halt two times in a row...I just
tried for some reason I don't know and this happened :).
--- End Message ---
--- Begin Message ---
Version: 2.86.ds1-66
I've tried to reproduce this problem without success. Because of
this, I believe the problem have been fixed by the many patches
applied since version 2.84-3, and is closing this bug.
Happy hacking,
--
Petter Reinholdtsen
--- End Message ---