killall5 in /etc/init.d/sendsigs should not kill ntfs-3g and other fuse filesystems

Bug #87763 reported by Agostino Russo
6
Affects Status Importance Assigned to Milestone
sysvinit (Ubuntu)
Fix Released
Wishlist
Colin Watson

Bug Description

Binary package hint: sysvutils

/etc/rc6.d/S20sendsigs calls killall5, which in turns kills all processes. This is a problem if ntfs-3g is used to mount a device, particularly if the mountpoint is /, whether the divice is directly or indirectly mounted (e.g. when / is inside a file on an ntfs partition). That prevents the other rc6 scripts that have to umount the devices to work properly and it will result in I/O errors. The same issue may affect other userspace filesystems.

Changed in sysvinit:
importance: Undecided → Wishlist
status: Unconfirmed → Confirmed
Revision history for this message
Henrik Nilsen Omma (henrik) wrote :

This is blocking https://wiki.ubuntu.com/InstallerForWindows

Scott, is this simply a bug or does changing this have important design implications elsewhere?

Changed in sysvinit:
assignee: nobody → keybuk
Revision history for this message
Colin Watson (cjwatson) wrote :

The attached (untested!) patch implements the '-o omitpid' option (option named in line with pidof) to exclude specified pids. I recommend using something like this in conjunction with an initscript change to read a list of pids to ignore from a file in (say) /var/run. I suspect we'll need a bit of extra glue to stash the file in /dev/.initramfs/ during boot, as /var/run won't be mounted yet at the point where we're mounting the root filesystem.

Colin Watson (cjwatson)
Changed in sysvinit:
assignee: keybuk → kamion
Revision history for this message
Colin Watson (cjwatson) wrote :

sysvinit (2.86.ds1-14.1ubuntu24) gutsy; urgency=low

  * Don't try to unmount tmpfses that don't exist, as they were probably
    mounted in the initramfs (LP: #124969).
  * Implement 'killall5 -o omitpid'; avoid killing pids listed in
    /var/run/sendsigs.omit in sendsigs (LP: #87763).

 -- Colin Watson <email address hidden> Mon, 06 Aug 2007 13:41:04 +0100

Changed in sysvinit:
status: Confirmed → Fix Released
Revision history for this message
Rudd-O (rudd-o) wrote :

The untested killall5 -o omitpid thing should have been tested because I'm using the omidpids protocol to avoid killall5 zfs-fuse, and it DOES NOT WORK at all. It just hangs there in "terminating remaining processes", even though I've confirmed it is doing the -o omitpid thing with echoes in the initscript. And obviously, I can't debug the issue because the machine is inaccessible at that time.

zfs-fuse is threaded, if you care to know, but it appears as only one pid in ps ax.

Changed in sysvinit:
status: Fix Released → Confirmed
Revision history for this message
Rudd-O (rudd-o) wrote :

another thing: if zfs-fuse has any pending i/o operations, it cannot be killed except with -9. But the killall5 is clearly hanging, not getting to the sleep 5 portion of the initscript.

ii initscripts 2.86.ds1-14.1ubuntu45 Scripts for initializing and shutting down the system

Revision history for this message
Rudd-O (rudd-o) wrote :

Oh I should have mentioned that sendsigs works okay if I start my system in single mode, and then poweroff. Everything powers down correctly when I do that, including my zfs script (which runs after sendsigs).

Revision history for this message
Rudd-O (rudd-o) wrote :

Colin, I have reimplemented the killall5 portion and attached it to this bug:

https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/151580

Sorry but your code fails with zfs-fuse and I have the strong suspicion it will also fail with ntfs-3g. It is just not enough to kill(-1, STOP), walk proc, then kill(CONT). You have to actively CONT those omitted processes right away, lest the walk through proc hangs on you (confirmed here).

Changed in sysvinit:
status: Confirmed → In Progress
Revision history for this message
Colin Watson (cjwatson) wrote :

I'm closing this again in favour of bug 151580; I think the bug history over there is more useful and there's certainly no point in having two bugs for the same thing.

Changed in sysvinit:
status: In Progress → Fix Released
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.