You are not logged in.

#1 2016-07-27 01:15:34

osalas
Member
From: Kaiserslautern, Germany
Registered: 2015-08-05
Posts: 25

MPD + CIFS equals slow Shutdown

I'm using a zombie LXQt with i3wm. My MPD works as expected I can listen to my music which is in a NAS (samba) server mounted with CIFS.
So far so good, I made a script for the i3bar and it shows what is playing and I can click on it to pause it or right-click to launch ncmpcpp in a terminal, fancy stuff. But lately, shutdown time increased drastically, I found out that MPD is being a little bi*** and it's not letting the shutdown happen until it's closed forcibly by a SIGTERM.

Jul 27 02:53:05 jarvis systemd-shutdown[1]: Sending SIGTERM to remaining processes...

If I close MPD before shutting down my computer, it is fast as usual. I have no idea if I have to make a systemd service to run a script that literally just has

mpd --kill

or is there is another much simple way to terminate mpd on time.

Offline

#2 2016-07-28 12:54:43

Awebb
Member
Registered: 2010-05-06
Posts: 6,285

Re: MPD + CIFS equals slow Shutdown

You might want to find out, what MPD is doing, when it is supposed to shut down.

Offline

#3 2016-07-28 14:11:29

osalas
Member
From: Kaiserslautern, Germany
Registered: 2015-08-05
Posts: 25

Re: MPD + CIFS equals slow Shutdown

Well if I shutdown the computer while still playing a song or just with mpd active it will set my mounted share folder as busy. So when the umount part of the shutdown tries to unmount the folder it won't do it because of that.

I did try to make the mpd.service to run a stop command but it won't run on time, it always try to unmount the folder before stopping mpd so it is always busy. As a work around I wrote a small script for the i3bar that has

mpd --kill ; systemctl poweroff

But it is a workaround, so if I try to shut it down by any other means it will hang.

Offline

#4 2016-07-28 14:29:11

Awebb
Member
Registered: 2010-05-06
Posts: 6,285

Re: MPD + CIFS equals slow Shutdown

Are you sure that's the only thing happening? Have you checked the logs and journals?

Offline

#5 2016-07-28 23:32:07

osalas
Member
From: Kaiserslautern, Germany
Registered: 2015-08-05
Posts: 25

Re: MPD + CIFS equals slow Shutdown

Here are some logs.
This log is the one of a bad reboot you can se that the pulseaudio (which is being used by mpd) show a IO error. Then you can se that the umount shows my share as busy and the last line is the ending of my user session. The log continues until it reaches the journal stopping which is NOT the moment the power turns off, it takes around 2 or 3 mins until it powers off completely.

Jul 29 00:31:52 jarvis systemd-logind[383]: System is rebooting.
Jul 29 00:31:52 jarvis systemd[1]: Stopping CUPS Scheduler...
Jul 29 00:31:52 jarvis pulseaudio[717]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
Jul 29 00:31:52 jarvis pulseaudio[717]:       after 12 requests (6 known processed) with 0 events remaining.
Jul 29 00:31:52 jarvis thermald[380]: Terminating ...
Jul 29 00:31:52 jarvis systemd[1]: Stopping RealtimeKit Scheduling Policy Service...
Jul 29 00:31:52 jarvis ntfs-3g[355]: Unmounting /dev/sda4 (OS_Install)
Jul 29 00:31:52 jarvis systemd[1]: Stopping Authorization Manager...
Jul 29 00:31:52 jarvis ntfs-3g[409]: Unmounting /dev/sdb1 (Data)
Jul 29 00:31:52 jarvis systemd[1]: Stopping Daemon for power management...
Jul 29 00:31:52 jarvis systemd[1]: Stopped target Graphical Interface.
Jul 29 00:31:52 jarvis systemd[1]: Stopped target Multi-User System.
Jul 29 00:31:52 jarvis systemd[1]: Stopping Initialize hardware monitoring sensors...
Jul 29 00:31:52 jarvis systemd[1]: Unmounting /mnt/EC920BB6920B83F4...
Jul 29 00:31:52 jarvis umount[29767]: umount: /cifs/192.168.1.4/Storage: target is busy
Jul 29 00:31:52 jarvis umount[29767]:         (In some cases useful info about processes that
Jul 29 00:31:52 jarvis umount[29767]:          use the device is found by lsof(8) or fuser(1).)
Jul 29 00:31:52 jarvis systemd[1]: Unmounting Mount Share at boot...
Jul 29 00:31:52 jarvis systemd[1]: Stopped target Sound Card.
Jul 29 00:31:52 jarvis systemd[1]: Closed Load/Save RF Kill Switch Status /dev/rfkill Watch.
Jul 29 00:31:52 jarvis systemd[1]: Stopping Session c2 of user *****.

This is the log of my workaround, the only error is the X11 dying before the lxqt-session realizes that. Other than that everything shuts down properly.

Jul 29 00:47:43 jarvis systemd-logind[375]: System is rebooting.
Jul 29 00:47:43 jarvis systemd[1]: Stopping User Manager for UID 1000...
Jul 29 00:47:43 jarvis systemd[1]: Stopping Manage, Install and Generate Color Profiles...
Jul 29 00:47:43 jarvis systemd[510]: Stopping Sound Service...
Jul 29 00:47:43 jarvis systemd[510]: Stopping Virtual filesystem service...
Jul 29 00:47:43 jarvis systemd[510]: Stopping D-Bus User Message Bus...
Jul 29 00:47:43 jarvis thermald[367]: Terminating ...
Jul 29 00:47:43 jarvis systemd[510]: Stopped target Default.
Jul 29 00:47:43 jarvis lxqt-session[521]: Process "Runner" ( LXQtModule(0xca5ef0) ) has to be restarted
Jul 29 00:47:43 jarvis systemd[1]: Unmounting /mnt/EC920BB6920B83F4...
Jul 29 00:47:43 jarvis systemd[512]: pam_unix(systemd-user:session): session closed for user *****
Jul 29 00:47:43 jarvis systemd[1]: Closed Load/Save RF Kill Switch Status /dev/rfkill Watch.
Jul 29 00:47:43 jarvis ntfs-3g[346]: Unmounting /dev/sda4 (OS_Install)
Jul 29 00:47:43 jarvis systemd[1]: Stopped target Graphical Interface.
Jul 29 00:47:43 jarvis ntfs-3g[400]: Unmounting /dev/sdb1 (Data)
Jul 29 00:47:43 jarvis systemd[1]: Stopped target Multi-User System.
Jul 29 00:47:43 jarvis systemd[1]: Unmounting Mount Share at boot...
Jul 29 00:47:43 jarvis systemd[1]: Stopped target Login Prompts.
Jul 29 00:47:43 jarvis systemd[1]: Starting Generate shutdown-ramfs...
Jul 29 00:47:43 jarvis systemd[1]: Stopping Simple Desktop Display Manager...
Jul 29 00:47:43 jarvis sddm[392]: Signal received: SIGTERM
Jul 29 00:47:43 jarvis lxqt-session[521]: The X11 connection broke (error 1). Did the X11 server die?
Jul 29 00:47:43 jarvis systemd[1]: Stopping Hostname Service...
Jul 29 00:47:43 jarvis systemd[1]: Stopping Disk Manager...
Jul 29 00:47:43 jarvis systemd[1]: Stopping CUPS Scheduler...
Jul 29 00:47:43 jarvis systemd[1]: Stopped target Timers.
Jul 29 00:47:43 jarvis systemd[1]: Stopped Daily man-db cache purge.
Jul 29 00:47:43 jarvis systemd[1]: Stopped target Sound Card.
Jul 29 00:47:43 jarvis systemd[510]: Stopped D-Bus User Message Bus.
Jul 29 00:47:43 jarvis systemd[1]: Stopped Daily verification of password and group files.
Jul 29 00:47:43 jarvis systemd[510]: Stopped Sound Service.
Jul 29 00:47:43 jarvis systemd[1]: Unmounting Mount Share at boot...
Jul 29 00:47:43 jarvis systemd[510]: Stopped Virtual filesystem service.
Jul 29 00:47:43 jarvis systemd[1]: Stopping RealtimeKit Scheduling Policy Service...
Jul 29 00:47:43 jarvis systemd[1]: Stopped Daily locate database update.
Jul 29 00:47:43 jarvis systemd[1]: Stopping Session c2 of user ****.

And this is the modified mpd.service that I have been trying to use with no success.

[Unit]
Description=Music Player Daemon
After=network-online.target sound.target cifs-192.168.1.4-Storage.mount
Before=shutdown.target reboot.target halt.target umount.target

[Service]
User=mpd
ExecStart=/usr/bin/mpd --no-daemon
# allow MPD to use real-time priority 50
LimitRTPRIO=50
LimitRTTIME=infinity

[Install]
WantedBy=default.target

Let me know if you see something I am missing smile

Offline

Board footer

Powered by FluxBB