You are not logged in.

#1 2012-09-04 21:09:36

stqn
Member
Registered: 2010-03-19
Posts: 1,189
Website

[SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

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

#2 2012-09-05 11:22:30

valr
Member
From: Belgium
Registered: 2012-01-08
Posts: 62

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

Maybe the netcfg debug option can provide more info ? https://wiki.archlinux.org/index.php/Netcfg#Debugging

Offline

#3 2012-09-05 19:01:14

stqn
Member
Registered: 2010-03-19
Posts: 1,189
Website

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

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

#4 2012-09-05 19:20:35

jouke
Member
Registered: 2009-10-14
Posts: 63

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

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

#5 2012-09-05 23:59:03

stqn
Member
Registered: 2010-03-19
Posts: 1,189
Website

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

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

#6 2012-09-06 16:31:22

daidai67
Member
Registered: 2012-09-06
Posts: 5

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

Just to say I got the exact same problem. Very strange that a "systemctl stop" is instantaneous contrary to the shutdown sequence

Offline

#7 2012-09-08 14:05:14

stqn
Member
Registered: 2010-03-19
Posts: 1,189
Website

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

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

#8 2012-09-08 16:32:57

lahwaacz
Wiki Admin
From: Czech Republic
Registered: 2012-05-29
Posts: 452

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

The 'KillMode=none' fix works fine for me.

Offline

#9 2012-09-12 10:57:21

drrossum
Member
From: Chicago
Registered: 2009-02-24
Posts: 69

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

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

#10 2012-09-15 18:55:06

Snark1994
Member
From: Wales
Registered: 2011-06-09
Posts: 30

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

jouke wrote:

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

#11 2012-10-06 09:18:21

jouke
Member
Registered: 2009-10-14
Posts: 63

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

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

#12 2012-10-13 12:24:27

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,838

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

jouke, this issue still affects netcfg@.service, and adding KillMode=none fixes it. Could you put it in the next release?

Offline

#13 2012-10-25 14:54:07

jrussell
Member
From: Cape Town, South Africa
Registered: 2012-08-16
Posts: 510

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

I still have this problem, system is 100% up-to-date - have not edited any .service files


bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U

Offline

#14 2012-11-03 16:36:29

boomshalek
Member
Registered: 2007-10-12
Posts: 97

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

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

#15 2012-11-03 18:24:48

stqn
Member
Registered: 2010-03-19
Posts: 1,189
Website

Re: [SOLVED] systemd stuck 5 min at shutdown (netcfg multi-profile daemon)

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

Board footer

Powered by FluxBB