upstart: compat utils do not behave like the sysv counterparts

Bug #93443 reported by Michael Biebl
2
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

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

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.

Changed in upstart:
importance: Undecided → Low
status: Unconfirmed → Confirmed
Changed in upstart:
status: Confirmed → Triaged
Revision history for this message
Michael Biebl (mbiebl) wrote :

Hi Scott,

is there any progress on this issue?

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

It's pretty far down my TODO list

Changed in upstart:
milestone: 0.5 → none
Changed in upstart:
importance: Undecided → Low
status: New → Triaged
Changed in upstart:
milestone: none → 0.5-later
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Will track on #388738

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.