[Bug 1061639] Re: Upstartification of /etc/init.d/networking has lost deconfiguring-networking event causing bad side-effects
Christian Niemeyer
chr.niemeyer at gmail.com
Wed Oct 17 22:03:35 UTC 2012
FINALLY worked! :) (for the first time ever with quantal!)
I tried about 2 hours shutting down manually. Stopping, starting init
scripts, networking etc. I found this only way, and it was to be done
exactly in this order. Contra: I have not yet figured the problem out
exactly. I think many commands are not mandatory. Now it would be the
time to sort them out.
I wrote a pseudo log file. Out of my bash history. I'm not an expert,
but I really hope you get the idea:
>>"(NOTE: DONE BEFORE: sudo apt-get remove --purge modemmanager
COMMENT: "TESTED IT WITH REBOOT, DIDN'T DO ANYTHING GOOD OR BAD ITSELF")
BOOT, FSCK ERROR MESSAGE (EXIT 1, ERRORS RESOLVED), BOOT CONTINUING...
LIGTHDM
CTRL+ALT+F2
LOGIN TERMINAL
sudo service lightdm stop
sudo service dbus stop
COMMENT: "THAT DID HANG FOR A WHILE, APPROX 5 SECONDS / THE SAME IF YOU STOP NETWORKING BEFORE DBUS, IT HANGS, KILLS DBUS, -- THIS ORDER IS BETTER"
sudo service dbus start
sudo service dbus stop
COMMENT: "NOW BOTH STARTS AND STOPS VERY FAST AND CLEAN"
sudo service networking stop
COMMENT: "NETWORKING STOPPED FAST AND CLEANLY"
sudo service networking start
COMMENT: "THEORY: FOR CLEAN SHUTDOWN WE HAVE START/STOP YET AGAIN"
sudo service networking stop
sudo service rsyslog stop
sudo modprobe -r forcedeth bnep rfcomm bluetooth
COMMENT: "SOMETIMES FORCEDETH MODULES BRINGS EVERYONE IN TROUBLE. WHAT ABOUT FORCEDETH? AND I GOT SOME MESSAGES WITH BLUETOOTH MODULE, – WHICH I DON'T HAVE BTW –, SO UNLOADING IT FOR A CLEAN STATE, –– BUT DIDN'T HELPED WHEN ONLY DOING THIS"
sync
sudo init 1
COMMENT: "TAKES A WHILE, AND KILLING ALL REMAINING PROCESSES SAYS IT FAILED"
COMMENT: "NOW WE'RE ROOT, SO NO SUDO. BUT I ADD IT FOR NO CONFUSION"
sudo service udev stop
COMMENT: "STILL THERE STILL GOING (I THINK THAT'S CORRECT). AND STOPS FAST AND CLEAN."
sudo /etc/init.d/networking start
COMMENT: "AGAIN STARTING, BUT ONLY INIT.D, NOT USING "SERVICE". IT SEEMS THAT STARTING/STOPPING THOSE SCRIPTS SOLVES OUR PROBLEM"
COMMENT: "...AND NOW STOPPING POSSIBLY ALL OF THEM"
sudo /etc/init.d/networking stop
sudo /etc/init.d/network-manager stop
sudo /etc/init.d/network-interface-security stop
sudo /etc/init.d/network-interface-container stop
sudo /etc/init.d/network-interface stop
COMMENT: "ALL STOPS FAST AND CLEAN, PROMPTS"
COMMENT: "NEARLY DONE! NOW WE MAKE SURE, THAT FSCK IS FORCED TO RUN. IF
ERRORS IT WILL SAY "WAS NOT CLEANY UMOUNTED. RETURN/EXIT VALUE: [1],
PRINTED ON SCREEN". IF NO ERROR IT WILL SAY "WAS MOUNTED X TIMES, CHECK
FORCED. RETURN VALUE: 0. NO EXIT/ERROR MESSAGE PRINTED, CLEAN;
CONTINUING BOOT"
sudo tune2fs -c 1 /dev/sda1 #max mount counts to 1
sudo tune2fs -C 100 /dev/sda1 #make believe, it was mounted 100 times
already, will trigger fsck on reboot
COMMENT: "DOING TESTING"
sudo lsof /
sudo fuser /
COMMENT: "AHA! LSOF STILL SHOW 2 (TWO!) PROCESSES NTPD RUNNING. BETTER
KILL THEM. HOWEVER, I DON'T THINK THEY ARE THE PROBLEM. BECAUSE IF I
ONLY KILL THEM, WITHOUT ALL THE PROCEDURE EXACTLY(!) IN ORDER ABOVE,
THEN IT DOESN'T HELP"
sudo killall -15 ntpd
COMMENT: "CHECKING"
sudo ps -e
sudo lsmod
COMMENT: "LOOKS GOOD!"
sudo sync; sync; sync; sudo init 6
***REBOOOT***
....AND...
==> CLEAN FILESYSTEM! :-)
WORKED!
********APPENDIX 01:
LSOF / (quite before the end, but before ntpd killing)
"sudo lsof /
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
init 1 root cwd DIR 8,1 4096 2 /
init 1 root rtd DIR 8,1 4096 2 /
init 1 root txt REG 8,1 163144 5938 /sbin/init
init 1 root mem REG 8,1 52152 5660 /lib/x86_64-linux-gnu/libnss_files-2.15.so
init 1 root mem REG 8,1 47712 5664 /lib/x86_64-linux-gnu/libnss_nis-2.15.so
init 1 root mem REG 8,1 97272 5654 /lib/x86_64-linux-gnu/libnsl-2.15.so
init 1 root mem REG 8,1 35712 5656 /lib/x86_64-linux-gnu/libnss_compat-2.15.so
init 1 root mem REG 8,1 135398 5691 /lib/x86_64-linux-gnu/libpthread-2.15.so
init 1 root mem REG 8,1 1811160 5596 /lib/x86_64-linux-gnu/libc-2.15.so
init 1 root mem REG 8,1 31784 5699 /lib/x86_64-linux-gnu/librt-2.15.so
init 1 root mem REG 8,1 277448 5608 /lib/x86_64-linux-gnu/libdbus-1.so.3.7.2
init 1 root mem REG 8,1 38920 5647 /lib/x86_64-linux-gnu/libnih-dbus.so.1.0.0
init 1 root mem REG 8,1 96280 5649 /lib/x86_64-linux-gnu/libnih.so.1.0.0
init 1 root mem REG 8,1 149312 5574 /lib/x86_64-linux-gnu/ld-2.15.so
kthreadd 2 root cwd DIR 8,1 4096 2 /
kthreadd 2 root rtd DIR 8,1 4096 2 /
ksoftirqd 3 root cwd DIR 8,1 4096 2 /
ksoftirqd 3 root rtd DIR 8,1 4096 2 /
migration 6 root cwd DIR 8,1 4096 2 /
migration 6 root rtd DIR 8,1 4096 2 /
watchdog/ 7 root cwd DIR 8,1 4096 2 /
watchdog/ 7 root rtd DIR 8,1 4096 2 /
cpuset 8 root cwd DIR 8,1 4096 2 /
cpuset 8 root rtd DIR 8,1 4096 2 /
khelper 9 root cwd DIR 8,1 4096 2 /
khelper 9 root rtd DIR 8,1 4096 2 /
netns 11 root cwd DIR 8,1 4096 2 /
netns 11 root rtd DIR 8,1 4096 2 /
sync_supe 12 root cwd DIR 8,1 4096 2 /
sync_supe 12 root rtd DIR 8,1 4096 2 /
bdi-defau 13 root cwd DIR 8,1 4096 2 /
bdi-defau 13 root rtd DIR 8,1 4096 2 /
kintegrit 14 root cwd DIR 8,1 4096 2 /
kintegrit 14 root rtd DIR 8,1 4096 2 /
kblockd 15 root cwd DIR 8,1 4096 2 /
kblockd 15 root rtd DIR 8,1 4096 2 /
ata_sff 16 root cwd DIR 8,1 4096 2 /
ata_sff 16 root rtd DIR 8,1 4096 2 /
khubd 17 root cwd DIR 8,1 4096 2 /
khubd 17 root rtd DIR 8,1 4096 2 /
md 18 root cwd DIR 8,1 4096 2 /
md 18 root rtd DIR 8,1 4096 2 /
kworker/0 20 root cwd DIR 8,1 4096 2 /
kworker/0 20 root rtd DIR 8,1 4096 2 /
khungtask 21 root cwd DIR 8,1 4096 2 /
khungtask 21 root rtd DIR 8,1 4096 2 /
kswapd0 22 root cwd DIR 8,1 4096 2 /
kswapd0 22 root rtd DIR 8,1 4096 2 /
ksmd 23 root cwd DIR 8,1 4096 2 /
ksmd 23 root rtd DIR 8,1 4096 2 /
khugepage 24 root cwd DIR 8,1 4096 2 /
khugepage 24 root rtd DIR 8,1 4096 2 /
fsnotify_ 25 root cwd DIR 8,1 4096 2 /
fsnotify_ 25 root rtd DIR 8,1 4096 2 /
ecryptfs- 26 root cwd DIR 8,1 4096 2 /
ecryptfs- 26 root rtd DIR 8,1 4096 2 /
crypto 27 root cwd DIR 8,1 4096 2 /
crypto 27 root rtd DIR 8,1 4096 2 /
kthrotld 36 root cwd DIR 8,1 4096 2 /
kthrotld 36 root rtd DIR 8,1 4096 2 /
binder 37 root cwd DIR 8,1 4096 2 /
binder 37 root rtd DIR 8,1 4096 2 /
deferwq 56 root cwd DIR 8,1 4096 2 /
deferwq 56 root rtd DIR 8,1 4096 2 /
charger_m 57 root cwd DIR 8,1 4096 2 /
charger_m 57 root rtd DIR 8,1 4096 2 /
devfreq_w 58 root cwd DIR 8,1 4096 2 /
devfreq_w 58 root rtd DIR 8,1 4096 2 /
scsi_eh_0 218 root cwd DIR 8,1 4096 2 /
scsi_eh_0 218 root rtd DIR 8,1 4096 2 /
scsi_eh_1 219 root cwd DIR 8,1 4096 2 /
scsi_eh_1 219 root rtd DIR 8,1 4096 2 /
kworker/u 220 root cwd DIR 8,1 4096 2 /
kworker/u 220 root rtd DIR 8,1 4096 2 /
scsi_eh_2 223 root cwd DIR 8,1 4096 2 /
scsi_eh_2 223 root rtd DIR 8,1 4096 2 /
scsi_eh_3 224 root cwd DIR 8,1 4096 2 /
scsi_eh_3 224 root rtd DIR 8,1 4096 2 /
kworker/u 226 root cwd DIR 8,1 4096 2 /
kworker/u 226 root rtd DIR 8,1 4096 2 /
scsi_eh_4 233 root cwd DIR 8,1 4096 2 /
scsi_eh_4 233 root rtd DIR 8,1 4096 2 /
usb-stora 234 root cwd DIR 8,1 4096 2 /
usb-stora 234 root rtd DIR 8,1 4096 2 /
scsi_eh_5 235 root cwd DIR 8,1 4096 2 /
scsi_eh_5 235 root rtd DIR 8,1 4096 2 /
usb-stora 236 root cwd DIR 8,1 4096 2 /
usb-stora 236 root rtd DIR 8,1 4096 2 /
scsi_eh_6 237 root cwd DIR 8,1 4096 2 /
scsi_eh_6 237 root rtd DIR 8,1 4096 2 /
scsi_eh_7 238 root cwd DIR 8,1 4096 2 /
scsi_eh_7 238 root rtd DIR 8,1 4096 2 /
kworker/0 244 root cwd DIR 8,1 4096 2 /
kworker/0 244 root rtd DIR 8,1 4096 2 /
ext4-dio- 269 root cwd DIR 8,1 4096 2 /
ext4-dio- 269 root rtd DIR 8,1 4096 2 /
edac-poll 612 root cwd DIR 8,1 4096 2 /
edac-poll 612 root rtd DIR 8,1 4096 2 /
ttm_swap 659 root cwd DIR 8,1 4096 2 /
ttm_swap 659 root rtd DIR 8,1 4096 2 /
flush-8:0 1081 root cwd DIR 8,1 4096 2 /
flush-8:0 1081 root rtd DIR 8,1 4096 2 /
bash 1941 root cwd DIR 8,1 4096 33793 /root
bash 1941 root rtd DIR 8,1 4096 2 /
bash 1941 root txt REG 8,1 959168 23 /bin/bash
bash 1941 root mem REG 8,1 52152 5660 /lib/x86_64-linux-gnu/libnss_files-2.15.so
bash 1941 root mem REG 8,1 47712 5664 /lib/x86_64-linux-gnu/libnss_nis-2.15.so
bash 1941 root mem REG 8,1 97272 5654 /lib/x86_64-linux-gnu/libnsl-2.15.so
bash 1941 root mem REG 8,1 35712 5656 /lib/x86_64-linux-gnu/libnss_compat-2.15.so
bash 1941 root mem REG 8,1 1811160 5596 /lib/x86_64-linux-gnu/libc-2.15.so
bash 1941 root mem REG 8,1 14792 5611 /lib/x86_64-linux-gnu/libdl-2.15.so
bash 1941 root mem REG 8,1 163312 5712 /lib/x86_64-linux-gnu/libtinfo.so.5.9
bash 1941 root mem REG 8,1 149312 5574 /lib/x86_64-linux-gnu/ld-2.15.so
kworker/0 1951 root cwd DIR 8,1 4096 2 /
kworker/0 1951 root rtd DIR 8,1 4096 2 /
ntpd 2047 ntp cwd DIR 8,1 4096 2 /
ntpd 2047 ntp rtd DIR 8,1 4096 2 /
ntpd 2047 ntp txt REG 8,1 662992 10978 /usr/sbin/ntpd
ntpd 2047 ntp mem REG 8,1 47712 5664 /lib/x86_64-linux-gnu/libnss_nis-2.15.so
ntpd 2047 ntp mem REG 8,1 97272 5654 /lib/x86_64-linux-gnu/libnsl-2.15.so
ntpd 2047 ntp mem REG 8,1 35712 5656 /lib/x86_64-linux-gnu/libnss_compat-2.15.so
ntpd 2047 ntp mem REG 8,1 105320 5697 /lib/x86_64-linux-gnu/libresolv-2.15.so
ntpd 2047 ntp mem REG 8,1 31128 5658 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
ntpd 2047 ntp mem REG 8,1 52152 5660 /lib/x86_64-linux-gnu/libnss_files-2.15.so
ntpd 2047 ntp mem REG 8,1 135398 5691 /lib/x86_64-linux-gnu/libpthread-2.15.so
ntpd 2047 ntp mem REG 8,1 92472 5728 /lib/x86_64-linux-gnu/libz.so.1.2.7
ntpd 2047 ntp mem REG 8,1 14792 5611 /lib/x86_64-linux-gnu/libdl-2.15.so
ntpd 2047 ntp mem REG 8,1 1811160 5596 /lib/x86_64-linux-gnu/libc-2.15.so
ntpd 2047 ntp mem REG 8,1 18936 5599 /lib/x86_64-linux-gnu/libcap.so.2.22
ntpd 2047 ntp mem REG 8,1 31784 5699 /lib/x86_64-linux-gnu/librt-2.15.so
ntpd 2047 ntp mem REG 8,1 1848736 5606 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
ntpd 2047 ntp mem REG 8,1 1030536 5637 /lib/x86_64-linux-gnu/libm-2.15.so
ntpd 2047 ntp mem REG 8,1 125512 7378 /usr/lib/libopts.so.25.10.0
ntpd 2047 ntp mem REG 8,1 149312 5574 /lib/x86_64-linux-gnu/ld-2.15.so
ntpd 2049 root cwd DIR 8,1 4096 2 /
ntpd 2049 root rtd DIR 8,1 4096 2 /
ntpd 2049 root txt REG 8,1 662992 10978 /usr/sbin/ntpd
ntpd 2049 root mem REG 8,1 105320 5697 /lib/x86_64-linux-gnu/libresolv-2.15.so
ntpd 2049 root mem REG 8,1 31128 5658 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
ntpd 2049 root mem REG 8,1 52152 5660 /lib/x86_64-linux-gnu/libnss_files-2.15.so
ntpd 2049 root mem REG 8,1 135398 5691 /lib/x86_64-linux-gnu/libpthread-2.15.so
ntpd 2049 root mem REG 8,1 92472 5728 /lib/x86_64-linux-gnu/libz.so.1.2.7
ntpd 2049 root mem REG 8,1 14792 5611 /lib/x86_64-linux-gnu/libdl-2.15.so
ntpd 2049 root mem REG 8,1 1811160 5596 /lib/x86_64-linux-gnu/libc-2.15.so
ntpd 2049 root mem REG 8,1 18936 5599 /lib/x86_64-linux-gnu/libcap.so.2.22
ntpd 2049 root mem REG 8,1 31784 5699 /lib/x86_64-linux-gnu/librt-2.15.so
ntpd 2049 root mem REG 8,1 1848736 5606 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
ntpd 2049 root mem REG 8,1 1030536 5637 /lib/x86_64-linux-gnu/libm-2.15.so
ntpd 2049 root mem REG 8,1 125512 7378 /usr/lib/libopts.so.25.10.0
ntpd 2049 root mem REG 8,1 149312 5574 /lib/x86_64-linux-gnu/ld-2.15.so
kworker/0 2063 root cwd DIR 8,1 4096 2 /
kworker/0 2063 root rtd DIR 8,1 4096 2 /
lsof 2138 root cwd DIR 8,1 4096 33793 /root
lsof 2138 root rtd DIR 8,1 4096 2 /
lsof 2138 root txt REG 8,1 163224 6534 /usr/bin/lsof
lsof 2138 root mem REG 8,1 1811160 5596 /lib/x86_64-linux-gnu/libc-2.15.so
lsof 2138 root mem REG 8,1 149312 5574 /lib/x86_64-linux-gnu/ld-2.15.so
lsof 2138 root 1w REG 8,1 4445 80418 /home/chris/shutdown_NEW_02.txt
lsof 2139 root cwd DIR 8,1 4096 33793 /root
lsof 2139 root rtd DIR 8,1 4096 2 /
lsof 2139 root txt REG 8,1 163224 6534 /usr/bin/lsof
lsof 2139 root mem REG 8,1 1811160 5596 /lib/x86_64-linux-gnu/libc-2.15.so
lsof 2139 root mem REG 8,1 149312 5574 /lib/x86_64-linux-gnu/ld-2.15.so
sudo fuser /
1 2 3 6 7 8 9 11 12 13 14 15 16 17 18 20 21 22 23 24 25 26 27 36 37 56 57 58 218 219 220 223 224 226 233 234 235 236 237 238 244 269 612 659 1081 1941 1951 2047 2049 2063ps -e | grep ntp
sudo killall -15 ntpd"
*******APPENDIX 02:
PS -E and LSMOD, just before Reboot (sync; sync; sync; sudo init 6)
"sudo ps -e
PID TTY TIME CMD
1 ? 00:00:00 init
2 ? 00:00:00 kthreadd
3 ? 00:00:00 ksoftirqd/0
6 ? 00:00:00 migration/0
7 ? 00:00:00 watchdog/0
8 ? 00:00:00 cpuset
9 ? 00:00:00 khelper
10 ? 00:00:00 kdevtmpfs
11 ? 00:00:00 netns
12 ? 00:00:00 sync_supers
13 ? 00:00:00 bdi-default
14 ? 00:00:00 kintegrityd
15 ? 00:00:00 kblockd
16 ? 00:00:00 ata_sff
17 ? 00:00:00 khubd
18 ? 00:00:00 md
20 ? 00:00:00 kworker/0:1
21 ? 00:00:00 khungtaskd
22 ? 00:00:00 kswapd0
23 ? 00:00:00 ksmd
24 ? 00:00:00 khugepaged
25 ? 00:00:00 fsnotify_mark
26 ? 00:00:00 ecryptfs-kthrea
27 ? 00:00:00 crypto
36 ? 00:00:00 kthrotld
37 ? 00:00:00 binder
56 ? 00:00:00 deferwq
57 ? 00:00:00 charger_manager
58 ? 00:00:00 devfreq_wq
218 ? 00:00:00 scsi_eh_0
219 ? 00:00:00 scsi_eh_1
220 ? 00:00:00 kworker/u:2
223 ? 00:00:00 scsi_eh_2
224 ? 00:00:00 scsi_eh_3
226 ? 00:00:00 kworker/u:5
233 ? 00:00:00 scsi_eh_4
234 ? 00:00:00 usb-storage
235 ? 00:00:00 scsi_eh_5
236 ? 00:00:00 usb-storage
237 ? 00:00:00 scsi_eh_6
238 ? 00:00:00 scsi_eh_7
244 ? 00:00:00 kworker/0:2
269 ? 00:00:00 ext4-dio-unwrit
612 ? 00:00:00 edac-poller
659 ? 00:00:00 ttm_swap
1081 ? 00:00:00 flush-8:0
1941 tty2 00:00:00 bash
1951 ? 00:00:00 kworker/0:0
2063 ? 00:00:00 kworker/0:3
2151 tty2 00:00:00 ps
sudo lsmod
Module Size Used by
parport_pc 32688 0
ppdev 17073 0
nouveau 895609 1
snd_intel8x0 38149 0
snd_ac97_codec 134272 1 snd_intel8x0
ttm 83595 1 nouveau
ac97_bus 12766 1 snd_ac97_codec
snd_pcm 96580 2 snd_intel8x0,snd_ac97_codec
drm_kms_helper 46784 1 nouveau
snd_seq_midi 13324 0
drm 275528 3 nouveau,ttm,drm_kms_helper
snd_rawmidi 30512 1 snd_seq_midi
snd_seq_midi_event 14899 1 snd_seq_midi
snd_seq 61521 2 snd_seq_midi,snd_seq_midi_event
i2c_algo_bit 13413 1 nouveau
mxm_wmi 12979 1 nouveau
serio_raw 13215 0
edac_core 52451 0
video 19335 1 nouveau
edac_mce_amd 23303 0
snd_timer 29425 2 snd_pcm,snd_seq
snd_seq_device 14497 3 snd_seq_midi,snd_rawmidi,snd_seq
wmi 19070 2 nouveau,mxm_wmi
k8temp 12978 0
snd 78734 7 snd_intel8x0,snd_ac97_codec,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
soundcore 15047 1 snd
snd_page_alloc 18484 2 snd_intel8x0,snd_pcm
mac_hid 13205 0
i2c_nforce2 13013 0
lp 17759 0
parport 46345 3 parport_pc,ppdev,lp
hid_generic 12493 0
usbhid 46947 0
hid 100366 2 hid_generic,usbhid
usb_storage 48838 0
pata_amd 14118 1
sata_nv 31830 0 "
(REMEMBER: before it was done: sudo modprobe -r forcedeth bnep rfcomm
bluetooth) <<
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ifupdown in Ubuntu.
https://bugs.launchpad.net/bugs/1061639
Title:
Upstartification of /etc/init.d/networking has lost deconfiguring-
networking event causing bad side-effects
Status in “ifupdown” package in Ubuntu:
Fix Released
Status in “ifupdown” source package in Quantal:
Fix Released
Bug description:
In precise, /etc/init.d/networking was a true SysV service script that
did the following:
initctl emit deconfiguring-networking
In quantal, /etc/init.d/networking is now using the upstart-job
symlink back to the upstart job /etc/init/networking.conf.
The problem is that the 'deconfiguring-networking' is no longer being
emitted. This causes dbus to fail to stop on system shutdown which
causes a cascading effect whereby other Upstart jobs are also not shut
down. Eventually, the system halt with the message:
mount: / is busy
This results in a unclean shutdown which can result in FSCK being run
/ slow / bad user boot experience.
The two main options here are:
1) Re-instate the 'deconfiguring-networking' event.
2) Change the dbus 'stop on' condition and update upstart-events.7 to remove 'deconfiguring-networking'.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1061639/+subscriptions
More information about the foundations-bugs
mailing list