Hi,

I'm attaching a patch adding mpd.service for systemd[1]. I'm submitting
it as a patch, as one of systemd's great idea is to let upstream ship
service files, so the "every distro packager writes his own rc script"
issue won't happen again. :)

Thanks,

Miklos

[1] http://www.freedesktop.org/wiki/Software/systemd
From d985e501df453cdb39971be104e92b0644d7aef5 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 |    8 ++++++++
 3 files changed, 25 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..187f061
--- /dev/null
+++ b/mpd.service.in
@@ -0,0 +1,8 @@
+[Unit]
+Description=Music Player Daemon
+
+[Service]
+ExecStart=@prefix@/bin/mpd --no-daemon
+
+[Install]
+WantedBy=multi-user.target
-- 
1.7.6

Attachment: pgpixO65qnuti.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