You are not logged in.
Hi, I’m trying to make systemd work and one of my problems is that shutdown hangs for five minutes (really) just after displaying:
[ OK ] Stopped target Remote File Systems
The next step is apparently “Netcfg multi-profile daemon”.
I followed the instructions to get systemd’s shutdown log, which confirmed that netcfg.service is the culprit, but doesn’t explain what it is waiting for:
(…)
[ 228.955139] systemd[1]: openntpd.service: cgroup is empty
[ 228.955211] systemd[1]: openntpd.service changed stop-sigterm -> dead
[ 228.955266] systemd[1]: Job openntpd.service/stop finished, result=done
[ 228.955330] systemd[1]: network.target changed active -> dead
[ 228.955333] systemd[1]: Job network.target/stop finished, result=done
[ 228.955367] systemd[1]: About to execute: /usr/bin/netcfg-daemon stop
[ 228.964029] systemd[1]: Forked /usr/bin/netcfg-daemon as 960
[ 228.964072] systemd[1]: netcfg.service changed exited -> stop
(…)
(some debug output from my wireless driver…)
[ 229.023442] systemd[1]: Received SIGCHLD from PID 960 (netcfg-daemon).
[ 229.023468] systemd[1]: Got SIGCHLD for process 960 (netcfg-daemon)
[ 229.023563] systemd[1]: Child 960 died (code=exited, status=0/SUCCESS)
[ 229.023567] systemd[1]: Child 960 belongs to netcfg.service
[ 229.023574] systemd[1]: netcfg.service: control process exited, code=exited status=0
[ 229.023755] systemd[1]: netcfg.service got final SIGCHLD for state stop
[ 229.023932] systemd[1]: netcfg.service changed stop -> stop-sigterm
[ 229.023980] systemd[1]: Got SIGCHLD for process 993 (wireless)
[ 229.024024] systemd[1]: Child 993 died (code=killed, status=9/KILL)
(…)
(some debug output from my wireless driver…)
[ 229.024587] systemd[1]: Received SIGCHLD from PID 497 (wpa_supplicant).
[ 229.024609] systemd[1]: Got SIGCHLD for process 497 (wpa_supplicant)
[ 229.024657] systemd[1]: Child 497 died (code=exited, status=0/SUCCESS)
(…)
(230-231: some debug output from my wireless driver…)
[ 319.022963] systemd[1]: netcfg.service stopping timed out. Killing.
[ 319.023222] systemd[1]: netcfg.service changed stop-sigterm -> stop-sigkill
[ 319.023236] systemd[1]: Running GC...
[ 409.022260] systemd[1]: netcfg.service still around after SIGKILL. Ignoring.
[ 409.022318] rtw_cmd_thread: leaving... check & free all cmd_obj resources
[ 409.022323] rtw_cmd_thread: leaving... call up terminate_cmdthread_sema
[ 409.022491] systemd[1]: netcfg.service changed stop-sigkill -> final-sigterm
[ 499.021524] systemd[1]: netcfg.service stopping timed out (2). Killing.
[ 499.021700] systemd[1]: netcfg.service changed final-sigterm -> failed
[ 499.022079] systemd[1]: Job netcfg.service/stop finished, result=done
[ 499.022229] systemd[1]: Unit netcfg.service entered failed state.
[ 499.022244] systemd[1]: basic.target changed active -> dead
(…)
My wireless driver is 8192cu from the AUR.
/etc/conf.d/netcfg:
NETWORKS=(@myssid)
WIRED_INTERFACE="eth0"
WIRELESS_INTERFACE="wlan0"
/etc/network.d/myssid:
CONNECTION='wireless'
DESCRIPTION='A simple WPA encrypted wireless connection using a static IP'
INTERFACE='wlan0'
SECURITY='wpa'
ESSID='my ssid'
KEY='my key'
IP='static'
ADDR='192.168.0.5'
GATEWAY='192.168.0.254'
DNS=('127.0.0.1')
(comments removed from both files)
Any idea?
Last edited by stqn (2012-11-03 18:07:46)
Offline
Maybe the netcfg debug option can provide more info ? https://wiki.archlinux.org/index.php/Netcfg#Debugging
Offline
Thanks valr. For now I think I solved it by copying /lib/systemd/system/netcfg.service to /etc/systemd/system/ and adding “TimeoutStopSec=1” to the “[Service]” section:
[Unit]
Description=Netcfg multi-profile daemon
Before=network.target
Wants=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/netcfg-daemon start
ExecStop=/usr/bin/netcfg-daemon stop
TimeoutStopSec=1
[Install]
WantedBy=multi-user.target
This way systemd doesn’t wait 90 s before trying to kill whatever it thinks must be stopped and doesn’t want to exit… but only 1 s.
Offline
This smells like a bug in systemd. It looks like it is trying to kill some forked-off process, while Type=oneshot should tell it there is no such thing. A better fix than through TimeoutStopSec=1 would be to add KillMode=none on that place. If this turns out to be a good fix and current systemd versions are still buggy, I will put this in the next netcfg release.
Start your testing!
Offline
I tried “KillMode=none” but got the 4 min 30 s wait again.
PS:
systemd 189-4
initscripts 2012.08.3-2
linux 3.5.3-1
Edit: Looks like the only process started by netcfg is wpa_supplicant:
$ systemctl status netcfg
netcfg.service - Netcfg multi-profile daemon
Loaded: loaded (/usr/lib/systemd/system/netcfg.service; disabled)
Active: active (exited) since Thu, 06 Sep 2012 15:09:48 +0200; 17min ago
Process: 327 ExecStart=/usr/bin/netcfg-daemon start (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/netcfg.service
└ 486 wpa_supplicant -B -P /run/wpa_supplicant_wlan0.pid...
According to my log above, wpa_supplicant exits quickly and cleanly, so I don’t know what systemd is trying to kill!
Last edited by stqn (2012-09-06 13:33:42)
Offline
Just to say I got the exact same problem. Very strange that a "systemctl stop" is instantaneous contrary to the shutdown sequence
Offline
I don’t undertand what’s going on; now even with my original fix (TimeoutStopSec=1), systemd still hangs! The log looks similar to previously.
My last update of systemd, initscripts and netcfg is from 2012-09-03.
Going back to initscripts for now.
Offline
The 'KillMode=none' fix works fine for me.
Offline
Having the same issue here. In the log I find:
Sep 10 16:45:38 idefix shutdown[1083]: shutting down for system reboot
...
Sep 10 16:47:08 idefix systemd[1]: netcfg.service stopping timed out. Killing.
Sep 10 16:47:08 idefix systemd[1]: Unit netcfg.service entered failed state.
Sep 10 16:47:08 idefix systemd[1]: Shutting down.
I have the same wait time if I do 'systemctl stop'. The netcfg setup is fine, using netcfg interactively works flawlessly.
Offline
This smells like a bug in systemd. It looks like it is trying to kill some forked-off process, while Type=oneshot should tell it there is no such thing. A better fix than through TimeoutStopSec=1 would be to add KillMode=none on that place. If this turns out to be a good fix and current systemd versions are still buggy, I will put this in the next netcfg release.
Start your testing!
jouke's fix seems to have worked for me - it was a slightly intermittent problem before, but I haven't had it in the week or so since I applied his fix.
Snark1994
Offline
The fix finally landed in [core] today. I wonder: was it still needed for recent systemd versions?
For reference: https://bugs.freedesktop.org/show_bug.cgi?id=54041
Offline
jouke, this issue still affects netcfg@.service, and adding KillMode=none fixes it. Could you put it in the next release?
Offline
I still have this problem, system is 100% up-to-date - have not edited any .service files
bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U
Offline
I am running netcfg-3.0-1 and the service has the KillMode=none now per default in it, but I still get stuck ... any news ?
EDIT: I am only connecting through eth0 with dhcp through netcfg@ethernet-dhcp.service
Last edited by boomshalek (2012-11-03 16:39:07)
Offline
Problem solved here with an up to date system (as of this morning) and the official netcfg service unit. I also changed a few of my startup files (.xinitrc, .zprofile) as per the latest wiki documentation, which might have helped.
boomshalek and jrussel, the only advice I can give is to check the systemd and any other relevant wiki page (your DE, DM, xinitrc…) to see if your configuration needs some fixes.
Offline