New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout at shutdown when mounting samba share with cifs and WLan #1435

Closed
PhilipMay opened this Issue Oct 1, 2015 · 11 comments

Comments

6 participants
@PhilipMay

PhilipMay commented Oct 1, 2015

Hello,
I am mounting a samba share with cifs (NetworkManager and WLan) and when I shutdown the computer I have a timeout (the shutdown hangs for 2 or 3 minutes).

Here is my fstab line:
//192.168.1.30/may /media/nasmay01may cifs _netdev,credentials=/etc/nasmay01-automountuser.credentials,noauto,x-systemd.automount,uid=root,gid=users,dir_mode=0770,file_mode=0660 0 0

I am using an up to date (1st Okt. 2015) arch linux with systemd 226. I am using NetworkManager and I am online via wlan.

Here is the output of "journalctl -b -1" after the reboot: http://eniak.info/static/2015-10-01-bootproblem-01.txt

What I tried in the past to solve the problem or to find a workaround (everything without success):

  • add x-systemd.requires=network-online.target as parameter
  • add x-systemd.requires=network.target as parameter
  • switched from NetworkManager to WPA_supplicant with systemd.networkd and systemd.resolved

Strange thing is: When I do not use wlan with NetworkManager and use lan with
"systemctl start dhcpcd@.service" I do not get a timeout and everything is fine.

Even when I use NetworkManager with lan instead of wlan it works without a timeout. See "journalctl -b -1" after the reboot with lan: http://eniak.info/static/2015-10-01-boot-ok-lan-01.txt

Please tell me how I can provide more information to solve this issue.

Thanks.

Edit: Added info about NetworkManager and lan instead of wlan.

@PhilipMay PhilipMay changed the title from Timeout at shutdown when mounting samba share with cifs to Timeout at shutdown when mounting samba share with cifs and WLan Oct 1, 2015

@arvidjaar

This comment has been minimized.

Show comment
Hide comment
@arvidjaar

arvidjaar Oct 1, 2015

Contributor

It looks like D-Bus is stopped very early which in turn causes wpa_supplicant and NetworkManager to abort. For wired interface it does not really matter (you still have it up) but it apparently kills wireless. Could you provide systemctl show dbus.service?

Contributor

arvidjaar commented Oct 1, 2015

It looks like D-Bus is stopped very early which in turn causes wpa_supplicant and NetworkManager to abort. For wired interface it does not really matter (you still have it up) but it apparently kills wireless. Could you provide systemctl show dbus.service?

@PhilipMay

This comment has been minimized.

Show comment
Hide comment
@PhilipMay

PhilipMay Oct 1, 2015

Ok thanks.
Here is the output of systemctl show dbus.service:

Type=simple
Restart=no
NotifyAccess=none
RestartUSec=100ms
TimeoutStartUSec=1min 30s
TimeoutStopUSec=1min 30s
WatchdogUSec=0
WatchdogTimestamp=Do 2015-10-01 16:09:31 CEST
WatchdogTimestampMonotonic=17850736
StartLimitInterval=10000000
StartLimitBurst=5
StartLimitAction=none
FailureAction=none
PermissionsStartOnly=no
RootDirectoryStartOnly=no
RemainAfterExit=no
GuessMainPID=yes
MainPID=421
ControlPID=0
FileDescriptorStoreMax=0
StatusErrno=0
Result=success
ExecMainStartTimestamp=Do 2015-10-01 16:09:31 CEST
ExecMainStartTimestampMonotonic=17850693
ExecMainExitTimestampMonotonic=0
ExecMainPID=421
ExecMainCode=0
ExecMainStatus=0
ExecStart={ path=/usr/bin/dbus-daemon ; argv[]=/usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation ; ignore_errors=no ; start_time=[Do 2015-10-01 16:09:31 CEST] ; stop_time=[n/a] ; pid=421 ; code=(null) ; status=0/0 }
ExecReload={ path=/usr/bin/dbus-send ; argv[]=/usr/bin/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }
Slice=system.slice
ControlGroup=/system.slice/dbus.service
MemoryCurrent=18446744073709551615
CPUUsageNSec=18446744073709551615
Delegate=no
CPUAccounting=no
CPUShares=18446744073709551615
StartupCPUShares=18446744073709551615
CPUQuotaPerSecUSec=infinity
BlockIOAccounting=no
BlockIOWeight=18446744073709551615
StartupBlockIOWeight=18446744073709551615
MemoryAccounting=no
MemoryLimit=18446744073709551615
DevicePolicy=auto
UMask=0022
LimitCPU=18446744073709551615
LimitFSIZE=18446744073709551615
LimitDATA=18446744073709551615
LimitSTACK=18446744073709551615
LimitCORE=18446744073709551615
LimitRSS=18446744073709551615
LimitNOFILE=4096
LimitAS=18446744073709551615
LimitNPROC=30736
LimitMEMLOCK=65536
LimitLOCKS=18446744073709551615
LimitSIGPENDING=30736
LimitMSGQUEUE=819200
LimitNICE=0
LimitRTPRIO=0
LimitRTTIME=18446744073709551615
OOMScoreAdjust=-900
Nice=0
IOScheduling=0
CPUSchedulingPolicy=0
CPUSchedulingPriority=0
TimerSlackNSec=50000
CPUSchedulingResetOnFork=no
NonBlocking=no
StandardInput=null
StandardOutput=journal
StandardError=inherit
TTYReset=no
TTYVHangup=no
TTYVTDisallocate=no
SyslogPriority=30
SyslogLevelPrefix=yes
SecureBits=0
CapabilityBoundingSet=18446744073709551615
MountFlags=0
PrivateTmp=no
PrivateNetwork=no
PrivateDevices=no
ProtectHome=no
ProtectSystem=no
SameProcessGroup=no
UtmpMode=init
IgnoreSIGPIPE=yes
NoNewPrivileges=no
SystemCallErrorNumber=0
RuntimeDirectoryMode=0755
KillMode=control-group
KillSignal=15
SendSIGKILL=yes
SendSIGHUP=no
Id=dbus.service
Names=dbus.service
Requires=dbus.socket basic.target
Wants=system.slice
WantedBy=multi-user.target
Conflicts=shutdown.target
Before=shutdown.target multi-user.target systemd-networkd.service
After=system.slice dbus.socket systemd-journald.socket basic.target
TriggeredBy=dbus.socket
Documentation=man:dbus-daemon(1)
Description=D-Bus System Message Bus
LoadState=loaded
ActiveState=active
SubState=running
FragmentPath=/usr/lib/systemd/system/dbus.service
UnitFileState=static
UnitFilePreset=disabled
InactiveExitTimestamp=Do 2015-10-01 16:09:31 CEST
InactiveExitTimestampMonotonic=17850737
ActiveEnterTimestamp=Do 2015-10-01 16:09:31 CEST
ActiveEnterTimestampMonotonic=17850737
ActiveExitTimestampMonotonic=0
InactiveEnterTimestampMonotonic=0
CanStart=yes
CanStop=yes
CanReload=yes
CanIsolate=no
StopWhenUnneeded=no
RefuseManualStart=no
RefuseManualStop=no
AllowIsolate=no
DefaultDependencies=yes
OnFailureJobMode=replace
IgnoreOnIsolate=no
IgnoreOnSnapshot=no
NeedDaemonReload=no
JobTimeoutUSec=0
JobTimeoutAction=none
ConditionResult=yes
AssertResult=yes
ConditionTimestamp=Do 2015-10-01 16:09:31 CEST
ConditionTimestampMonotonic=17850177
AssertTimestamp=Do 2015-10-01 16:09:31 CEST
AssertTimestampMonotonic=17850178
Transient=no

PhilipMay commented Oct 1, 2015

Ok thanks.
Here is the output of systemctl show dbus.service:

Type=simple
Restart=no
NotifyAccess=none
RestartUSec=100ms
TimeoutStartUSec=1min 30s
TimeoutStopUSec=1min 30s
WatchdogUSec=0
WatchdogTimestamp=Do 2015-10-01 16:09:31 CEST
WatchdogTimestampMonotonic=17850736
StartLimitInterval=10000000
StartLimitBurst=5
StartLimitAction=none
FailureAction=none
PermissionsStartOnly=no
RootDirectoryStartOnly=no
RemainAfterExit=no
GuessMainPID=yes
MainPID=421
ControlPID=0
FileDescriptorStoreMax=0
StatusErrno=0
Result=success
ExecMainStartTimestamp=Do 2015-10-01 16:09:31 CEST
ExecMainStartTimestampMonotonic=17850693
ExecMainExitTimestampMonotonic=0
ExecMainPID=421
ExecMainCode=0
ExecMainStatus=0
ExecStart={ path=/usr/bin/dbus-daemon ; argv[]=/usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation ; ignore_errors=no ; start_time=[Do 2015-10-01 16:09:31 CEST] ; stop_time=[n/a] ; pid=421 ; code=(null) ; status=0/0 }
ExecReload={ path=/usr/bin/dbus-send ; argv[]=/usr/bin/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }
Slice=system.slice
ControlGroup=/system.slice/dbus.service
MemoryCurrent=18446744073709551615
CPUUsageNSec=18446744073709551615
Delegate=no
CPUAccounting=no
CPUShares=18446744073709551615
StartupCPUShares=18446744073709551615
CPUQuotaPerSecUSec=infinity
BlockIOAccounting=no
BlockIOWeight=18446744073709551615
StartupBlockIOWeight=18446744073709551615
MemoryAccounting=no
MemoryLimit=18446744073709551615
DevicePolicy=auto
UMask=0022
LimitCPU=18446744073709551615
LimitFSIZE=18446744073709551615
LimitDATA=18446744073709551615
LimitSTACK=18446744073709551615
LimitCORE=18446744073709551615
LimitRSS=18446744073709551615
LimitNOFILE=4096
LimitAS=18446744073709551615
LimitNPROC=30736
LimitMEMLOCK=65536
LimitLOCKS=18446744073709551615
LimitSIGPENDING=30736
LimitMSGQUEUE=819200
LimitNICE=0
LimitRTPRIO=0
LimitRTTIME=18446744073709551615
OOMScoreAdjust=-900
Nice=0
IOScheduling=0
CPUSchedulingPolicy=0
CPUSchedulingPriority=0
TimerSlackNSec=50000
CPUSchedulingResetOnFork=no
NonBlocking=no
StandardInput=null
StandardOutput=journal
StandardError=inherit
TTYReset=no
TTYVHangup=no
TTYVTDisallocate=no
SyslogPriority=30
SyslogLevelPrefix=yes
SecureBits=0
CapabilityBoundingSet=18446744073709551615
MountFlags=0
PrivateTmp=no
PrivateNetwork=no
PrivateDevices=no
ProtectHome=no
ProtectSystem=no
SameProcessGroup=no
UtmpMode=init
IgnoreSIGPIPE=yes
NoNewPrivileges=no
SystemCallErrorNumber=0
RuntimeDirectoryMode=0755
KillMode=control-group
KillSignal=15
SendSIGKILL=yes
SendSIGHUP=no
Id=dbus.service
Names=dbus.service
Requires=dbus.socket basic.target
Wants=system.slice
WantedBy=multi-user.target
Conflicts=shutdown.target
Before=shutdown.target multi-user.target systemd-networkd.service
After=system.slice dbus.socket systemd-journald.socket basic.target
TriggeredBy=dbus.socket
Documentation=man:dbus-daemon(1)
Description=D-Bus System Message Bus
LoadState=loaded
ActiveState=active
SubState=running
FragmentPath=/usr/lib/systemd/system/dbus.service
UnitFileState=static
UnitFilePreset=disabled
InactiveExitTimestamp=Do 2015-10-01 16:09:31 CEST
InactiveExitTimestampMonotonic=17850737
ActiveEnterTimestamp=Do 2015-10-01 16:09:31 CEST
ActiveEnterTimestampMonotonic=17850737
ActiveExitTimestampMonotonic=0
InactiveEnterTimestampMonotonic=0
CanStart=yes
CanStop=yes
CanReload=yes
CanIsolate=no
StopWhenUnneeded=no
RefuseManualStart=no
RefuseManualStop=no
AllowIsolate=no
DefaultDependencies=yes
OnFailureJobMode=replace
IgnoreOnIsolate=no
IgnoreOnSnapshot=no
NeedDaemonReload=no
JobTimeoutUSec=0
JobTimeoutAction=none
ConditionResult=yes
AssertResult=yes
ConditionTimestamp=Do 2015-10-01 16:09:31 CEST
ConditionTimestampMonotonic=17850177
AssertTimestamp=Do 2015-10-01 16:09:31 CEST
AssertTimestampMonotonic=17850178
Transient=no

@poettering

This comment has been minimized.

Show comment
Hide comment
@poettering

poettering Oct 1, 2015

Member

I figure NM should order itself explicitly after dbus, if it requires it to shut down cleanly...

Member

poettering commented Oct 1, 2015

I figure NM should order itself explicitly after dbus, if it requires it to shut down cleanly...

@martinpitt

This comment has been minimized.

Show comment
Hide comment
@martinpitt

martinpitt Oct 1, 2015

Contributor

NM itself is fine, but this smells like the same old "dbus dies too early for wpasupplicant" issue again, so wpasupplicant needs an After=dbus.service. See https://bugs.freedesktop.org/show_bug.cgi?id=89847 for some historic discussion.

Contributor

martinpitt commented Oct 1, 2015

NM itself is fine, but this smells like the same old "dbus dies too early for wpasupplicant" issue again, so wpasupplicant needs an After=dbus.service. See https://bugs.freedesktop.org/show_bug.cgi?id=89847 for some historic discussion.

@PhilipMay

This comment has been minimized.

Show comment
Hide comment
@PhilipMay

PhilipMay Oct 1, 2015

I added After=dbus.service to NetworkManager and wpa_supplicant. Didnt change anything. See the new log here: http://eniak.info/static/2015-10-01-bootproblem-03.txt

PhilipMay commented Oct 1, 2015

I added After=dbus.service to NetworkManager and wpa_supplicant. Didnt change anything. See the new log here: http://eniak.info/static/2015-10-01-bootproblem-03.txt

@PhilipMay

This comment has been minimized.

Show comment
Hide comment
@PhilipMay

PhilipMay Oct 1, 2015

Hello,
I finaly found the solution. Thanks so much for pointing me into the right direction. I had to do this:

$ cat /etc/systemd/system/wpa_supplicant.service.d/override.conf
[Unit]
After=dbus.service
Before=network.target
Wants=network.target

Remark: Before=network.target and Wants=network.target is already added in wpa_supplicant Version 2.5. But Arch Linux is using version 2.3 at the moment (1st Okt. 2015).
I will write a bug report for wpa_supp.

PhilipMay commented Oct 1, 2015

Hello,
I finaly found the solution. Thanks so much for pointing me into the right direction. I had to do this:

$ cat /etc/systemd/system/wpa_supplicant.service.d/override.conf
[Unit]
After=dbus.service
Before=network.target
Wants=network.target

Remark: Before=network.target and Wants=network.target is already added in wpa_supplicant Version 2.5. But Arch Linux is using version 2.3 at the moment (1st Okt. 2015).
I will write a bug report for wpa_supp.

@martinpitt

This comment has been minimized.

Show comment
Hide comment
@martinpitt

martinpitt Oct 1, 2015

Contributor

Awesome, thanks Philip! Indeed Before=network.target sounds right, as on shutdown we shouldn't tear it down when network using services are still up.

Contributor

martinpitt commented Oct 1, 2015

Awesome, thanks Philip! Indeed Before=network.target sounds right, as on shutdown we shouldn't tear it down when network using services are still up.

@martinpitt martinpitt closed this Oct 1, 2015

@mbiebl

This comment has been minimized.

Show comment
Hide comment
@mbiebl

mbiebl Oct 1, 2015

Contributor

Looking at
http://w1.fi/cgit/hostap/tree/wpa_supplicant/systemd/wpa_supplicant.service.in
, someone should probably poke wpasupplicant upstream to add a
After=dbus.service

2015-10-01 18:27 GMT+02:00 Martin Pitt notifications@github.com:

Closed #1435 #1435.


Reply to this email directly or view it on GitHub
#1435 (comment).

Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

Contributor

mbiebl commented Oct 1, 2015

Looking at
http://w1.fi/cgit/hostap/tree/wpa_supplicant/systemd/wpa_supplicant.service.in
, someone should probably poke wpasupplicant upstream to add a
After=dbus.service

2015-10-01 18:27 GMT+02:00 Martin Pitt notifications@github.com:

Closed #1435 #1435.


Reply to this email directly or view it on GitHub
#1435 (comment).

Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

@PhilipMay

This comment has been minimized.

Show comment
Hide comment
@PhilipMay

PhilipMay Oct 1, 2015

I have written a bug report mail to the wpa_supplicant developer (j@w1.fi). They do not have a bug tracking tool.

PhilipMay commented Oct 1, 2015

I have written a bug report mail to the wpa_supplicant developer (j@w1.fi). They do not have a bug tracking tool.

@marcosfrm

This comment has been minimized.

Show comment
Hide comment
@marcosfrm

marcosfrm Sep 21, 2017

Contributor

After=dbus.service is still needed in wpa_supplicant.service, right? Time to ping wpa_supplicant folks again.

Contributor

marcosfrm commented Sep 21, 2017

After=dbus.service is still needed in wpa_supplicant.service, right? Time to ping wpa_supplicant folks again.

@marcosfrm

This comment has been minimized.

Show comment
Hide comment
@marcosfrm

marcosfrm Sep 28, 2017

Contributor

I was having the same problem with NetworkManager. By default, when we connect to wifi using nm-applet, connection is saved with connection.permissions set to current user. At user logout, NM disconnects (before system shutdown). Solution is configure the connection as "global", not restricted to any user:

$ nmcli connection modify <ssid> connection.permissions ""

Anyway, shall the lack of After=dbus.service in wpa_supplicant.service be reported?

wpa_supplicant.service has Before=network.target. It is network daemon responsibility also order itself before network.target and if it needs to talk to wpa_supplicant on shutdown have proper After=dbus.service. Makes sense?

Contributor

marcosfrm commented Sep 28, 2017

I was having the same problem with NetworkManager. By default, when we connect to wifi using nm-applet, connection is saved with connection.permissions set to current user. At user logout, NM disconnects (before system shutdown). Solution is configure the connection as "global", not restricted to any user:

$ nmcli connection modify <ssid> connection.permissions ""

Anyway, shall the lack of After=dbus.service in wpa_supplicant.service be reported?

wpa_supplicant.service has Before=network.target. It is network daemon responsibility also order itself before network.target and if it needs to talk to wpa_supplicant on shutdown have proper After=dbus.service. Makes sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment