You are not logged in.

#1 2011-05-25 20:40:06

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

MPD starting and stopping at shutdown

I have added mpd to my gnome3 startup programs by running gnome-session-properties and adding mpd ~/.mpd/mpd.conf but no dice, I have to run the command myself before I can play any music.

My other issue is it causes my boot-down process to stall. I believe this is because my music in on a NAS. Switching to Alt+F8 on shut down I see it fails to unmount network file-systems because they are busy, then it stops the network, then when it gets to unmounting file-systems it just hangs at 'BUSY'.

This is avoided if I remember to issue mpd --kill before a reboot or shutdown.

I was thinking, looking at the other startup programs, maybe MPD will work if I point to the binary explicitly; i.e.  /usr/bin/mpd.

Offline

#2 2011-05-25 20:46:24

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: MPD starting and stopping at shutdown

hack a rc.d script to run it as your user? With smart placement in the daemon array it should be started after the network is up, and killed before it goes down.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2011-05-26 00:07:44

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: MPD starting and stopping at shutdown

I have edited /etc/rc.conf and added mpd to the daemons array. I have also edited /etc/rc.d/mpd to use the conf file at ~/.mpd/mpd.conf.

I know have MPD starting up absolutely fine, I still need to kill mpd myself before going to shutdown to avoid an issue with networked drives.

How can I get MPD to be killed before the system tries to unmount the networked filesystems?

Offline

#4 2011-05-26 06:55:14

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: MPD starting and stopping at shutdown

Use netcfg or wicd and create a pre_down hook (https://wiki.archlinux.org/index.php/Ne … _up.2Fdown)

Example for netcfg:

/etc/network.d/interfaces/eth0
PRE_DOWN="rc.d stop mpd; umount yournetworksharehere"

You could also place those commands somewhere at the top of your /etc/rc.shutdown or /etc/rc.local.shutdown.
You just have to find a place where the commands get executed before the filesystems are unmounted. I'd put it in rc.shutdown somewhere before the
"stat_busy 'Unmounting Filesystems'" part.

Regards,
demian

Last edited by demian (2011-05-26 06:59:35)


no place like /home
github

Offline

#5 2011-05-26 07:34:10

kowalski
Member
Registered: 2009-05-07
Posts: 82

Re: MPD starting and stopping at shutdown

Why not use /etc/rc.local.shutdown for this?
Just put

/usr/bin/mpc stop > /dev/null
/bin/umount -t cifs -a

in there.
Replace "cifs" with any filesystem type applicable (like "nfs" or whatever it is you use).


He who says A doesn't have to say B. He can also recognize that A was false.

Offline

#6 2011-05-26 13:20:48

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: MPD starting and stopping at shutdown

OK, so editing the rc files wasn't working. So I've just copied this onto my local hard drive. I'll just have to keep this and my iTunes library in sync manually.

Offline

Board footer

Powered by FluxBB