FS#25472 - [initscripts] Processes still running when unmount initiated
Attached to Project:
Arch Linux
Opened by jason ryan (jasonwryan) - Tuesday, 09 August 2011, 04:54 GMT
Last edited by Tom Gundersen (tomegun) - Thursday, 20 October 2011, 23:04 GMT
Opened by jason ryan (jasonwryan) - Tuesday, 09 August 2011, 04:54 GMT
Last edited by Tom Gundersen (tomegun) - Thursday, 20 October 2011, 23:04 GMT
|
Details
Description: During shutdown from TTY, laptop-mode tools is
still shutting down (from a script in
/etc/rc.local.shutdown) when the umount command is invoked,
resulting in the root filessytem not being cleanly
unmounted/remounted.
If I log into X, the longer shutdown process allows for LMT to be shutdown in time and the filesystem is unmounted/remounted cleanly. Additional info: * package version(s) Initscripts: 2011.07.3-1 Kernel: 3.0 Laptop-mode-tools 1.59-1 * config and/or log files etc. Log files here: https://bbs.archlinux.org/viewtopic.php?pid=972383#p972383 Steps to reproduce: Log into TTY and either reboot or shutdown with laptop-mode-tools being separately shutdown from /etc/rc.local.shutdown. |
This task depends upon
Closed by Tom Gundersen (tomegun)
Thursday, 20 October 2011, 23:04 GMT
Reason for closing: No response
Thursday, 20 October 2011, 23:04 GMT
Reason for closing: No response
I have a system with /, /var, /home and swap on LVs. All filesystems unmount cleanly when no snapshots exist. But the existence of a snapshot of any LV causes 'Unmounting...' to fail to unmount at shutdown/restart. Upon reboot, the LV containing /var is checked for consistency. I initially encountered the problem on a 64-bit installation to a physical machine, but have duplicated it on a 32-bit installation to a VBox VM.
Further, I simplified the configuration by copying the contents of the /var and /home LVs to the / LV. In this case, 'Unmounting...' and 'Remounting Root...' fail when a snapshot exists, even a snapshot of the (now unused) /home or /var LVs.
There seems to be several problems gonig on. First of all, no processes should stay around until the "kill_all" phase, but even if they do, they should, well..., die when they are killed.
@jasonwryan:
Could you post rc.local.shutdown (and any non-standard scripts it might call)?
@alphaniner:
Could you post the output of ps and lsof, obtained like jason did in the above forum thread? Also, could you post your fstab and rc.conf?
One quick suggestion: could you try to see if the problem is solved by replacing
# stop monitoring of lvm2 groups before unmounting filesystems
[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) && -d /sys/block ]] &&
status "Deactivating monitoring of LVM2 groups" \
vgchange --monitor n &>/dev/null
by simply:
vgchange --monitor n
?
--
#!/bin/bash
lm="rc.d list | grep laptop"
ofl="$(grep "off-line" <(acpi -V))"
if [ -n "$ofl" ] && [ -n "$lm" ]; then
rc.d stop laptop-mode
fi
--
# edit: also, it ocassionally does fail when shutting down for X...
Also, I don't know if this is useful but the 'Sending SIGTERM...' step takes much longer when a snapshot exists. I tried to redirect the output of the killall5 commands in the kill_all function from /etc/rc.d/functions:
stat_busy "Sending SIGTERM To Processes"
local i
killall5 -15 ${omit_pids[@]/#/-o } &>/kill_all
for (( i=0; i<20 && $?!=2; i++ )); do
sleep .25 # 1/4 second
killall5 -18 ${omit_pids[@]/#/-o } &>/kill_all-$i
done
stat_done
but all I got was empty files. Interestingly (maybe) I had files named kill_all-0 through kill_all-19, so it looks like the step is timing out. But then you may have already gathered that.
In any case, thank you.
fstab and rc.conf attached.
rc.conf (3.8 KiB)
During normal operation, I have one /sbin/dmeventd proc:
root 378 0.0 1.3 14212 13988 ? S<Lsl 18:45 0:00 /sbin/dmeventd
After unmonitor, a second one appears:
root 378 0.0 1.3 14212 13988 ? S<Lsl 18:45 0:00 /sbin/dmeventd
root 610 0.0 0.0 2304 524 ? Ss 18:45 0:00 /sbin/dmeventd
610 goes down with a TERM; 378 took a KILL. But unmounting still failed.
/etc/rc.local.shutdown is empty, other files are in attachment.
# edit:
packages:
kernel 3.0.1-1
initscripts 2011.07.3-1
laptop-mode-tools 1.59-1
rc.conf (3.9 KiB)
ps.out (5.5 KiB)
lsof.out (15.8 KiB)