upstart: compat utils do not behave like the sysv counterparts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
Triaged
|
Low
|
Unassigned | ||
upstart (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
Reading the man page of sysvinit/halt:
..
Halt notes that the system is being brought down in the file /var/log/wtmp, and
then either tells the kernel to halt, reboot or poweroff the system.
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.
...
Yet, upstarts compat utils (reboot, and the symlinks halt and poweroff) behave differently.
To actually power down/reboot the system, you have to explicitely pass the -f flag to them, regardless which runlevel is currently active. If not called with -f it always calls shutdown.
According to the sysvinit man page, this should not be necessary in runlevel 0 or 6.
And indeed, the sysv initscripts of distros like Gentoo or Fedora, don't use -f in their final halt call and fail because of that.
Upstart's compat utils should be adapted accordingly so that the initscripts of these distributions run altered in compat mode.
And just for the sake of consistency with sysvinit, the symlinks should be:
reboot -> halt
poweroff -> halt
and not
halt -> reboot
poweroff -> reboot
Changed in upstart: | |
status: | Confirmed → Triaged |
Changed in upstart: | |
milestone: | 0.5 → none |
Changed in upstart: | |
importance: | Undecided → Low |
status: | New → Triaged |
Changed in upstart: | |
milestone: | none → 0.5-later |
I thought that problem here is that sysvinit "knows" the runlevel, because it's a variable that it stores; however I see that halt actually just checks the utmp file, so we could use the same trick.
Thanks for that;
I don't agree that the symlinks need to be the right way around though; reboot() is the syscall, so that's what the binary is named, instead of halt. This is actually because I intend to produce non-compat variants in the future that just do the right thing. It doesn't make much of a difference for compatibility.