On Wed, Sep 28, 2011 at 12:05:02AM +0200, Wieland Hoffmann 
<themi...@googlemail.com> wrote:
> I think your service should have "After=sound.target" in the [Unit] 
> section so it doesn't get started before sound cards are set up.

Oh, indeed. Updated patch attached.
From 6f3d63c74a340acf7799a8aaeb94245b87fc6ecc Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmik...@frugalware.org>
Date: Tue, 27 Sep 2011 23:10:05 +0200
Subject: [PATCH] Install systemd service file if systemd is available

---
 Makefile.am    |    9 +++++++++
 configure.ac   |    8 ++++++++
 mpd.service.in |    9 +++++++++
 3 files changed, 26 insertions(+), 0 deletions(-)
 create mode 100644 mpd.service.in

diff --git a/Makefile.am b/Makefile.am
index 87eaf5a..58d797a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -870,6 +870,15 @@ FILTER_SRC = \
 
 
 #
+# systemd unit
+#
+
+if HAVE_SYSTEMD
+systemdsystemunit_DATA = \
+       mpd.service
+endif
+
+#
 # Sparse code analysis
 #
 # sparse is a semantic parser
diff --git a/configure.ac b/configure.ac
index 2463557..c2974f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,6 +33,13 @@ fi
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 PKG_PROG_PKG_CONFIG
+AC_ARG_WITH([systemdsystemunitdir],
+           AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for 
systemd service files]),
+           [], [with_systemdsystemunitdir=$($PKG_CONFIG 
--variable=systemdsystemunitdir systemd)])
+if test "x$with_systemdsystemunitdir" != xno; then
+       AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+fi
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a 
"x$with_systemdsystemunitdir" != xno ])
 
 dnl ---------------------------------------------------------------------------
 dnl Declare Variables
@@ -1616,5 +1623,6 @@ dnl Generate files
 dnl ---------------------------------------------------------------------------
 AC_OUTPUT(Makefile)
 AC_OUTPUT(doc/doxygen.conf)
+AC_OUTPUT(mpd.service)
 
 echo 'MPD is ready for compilation, type "make" to begin.'
diff --git a/mpd.service.in b/mpd.service.in
new file mode 100644
index 0000000..9e9282f
--- /dev/null
+++ b/mpd.service.in
@@ -0,0 +1,9 @@
+[Unit]
+Description=Music Player Daemon
+After=sound.target
+
+[Service]
+ExecStart=@prefix@/bin/mpd --no-daemon
+
+[Install]
+WantedBy=multi-user.target
-- 
1.7.6

Attachment: pgpWgyqupyLJc.pgp
Description: PGP signature

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to