net-misc/gerbera: Fix init scripts
authorIan Whyman <thev00d00@gentoo.org>
Sat, 17 Jun 2017 16:33:47 +0000 (17:33 +0100)
committerIan Whyman <thev00d00@gentoo.org>
Sat, 17 Jun 2017 16:34:03 +0000 (17:34 +0100)
Fixes #621934

Package-Manager: Portage-2.3.5, Repoman-2.3.2

net-misc/gerbera/files/gerbera-1.0.0.confd
net-misc/gerbera/files/gerbera-1.0.0.initd
net-misc/gerbera/files/gerbera.tmpfiles [new file with mode: 0644]
net-misc/gerbera/gerbera-1.0.0-r1.ebuild [moved from net-misc/gerbera/gerbera-1.0.0.ebuild with 95% similarity]
net-misc/gerbera/gerbera-9999.ebuild

index 7f5c00830251a2071f2f34c66dbc363a90f20e31..4c4a442203518b1e0915e6a9bb239797ed22dbc7 100644 (file)
@@ -1,28 +1,25 @@
-# /etc/conf.d/mediatomb: config file for /etc/init.d/mediatomb
+# /etc/conf.d/gerbera: config file for /etc/init.d/gerbera
 
-# See the mediatomb(1) manpage for more info.
+# See the gerbera(1) manpage for more info.
 
-# MediaTomb Web UI port.
+# Gerbera Web UI port.
 # NOTE: The minimum value allowed is 49152
-MEDIATOMB_PORT=49152
+GERBERA_PORT=49152
 
-# Run MediaTomb as this user.
-# NOTE: For security reasons do not run MediaTomb as root.
-MEDIATOMB_USER="mediatomb"
+# Run Gerbera as this user.
+# NOTE: For security reasons do not run Gerbera as root.
+GERBERA_USER="gerbera"
 
-# Run MediaTomb as this group.
-# NOTE: For security reasons do not run MediaTomb as root.
-MEDIATOMB_GROUP="mediatomb"
+# Run Gerbera as this group.
+# NOTE: For security reasons do not run Gerbera as root.
+GERBERA_GROUP="gerbera"
 
-# Path to MediaTomb config file.
-MEDIATOMB_CONFIG="/etc/mediatomb/config.xml"
+# Path to Gerbera config file.
+GERBERA_CONFIG="/etc/gerbera/config.xml"
 
-# Path to MediaTomb log file.
-MEDIATOMB_LOGFILE="/var/log/mediatomb.log"
+# Path to Gerbera log file.
+GERBERA_LOGFILE="/var/log/gerbera.log"
 
-# Path to MediaTomb pid file.
-MEDIATOMB_PIDFILE="/var/run/mediatomb.pid"
-
-# Other options you want to pass to MediaTomb.
-# Add "--interface ${MEDIATOMB_INTERFACE}" to bind to a named interface.
-MEDIATOMB_OPTIONS=""
+# Other options you want to pass to Gerbera.
+# Add "--interface ${GERBERA_INTERFACE}" to bind to a named interface.
+GERBERA_OPTIONS=""
index 86111395d7d1465d8e799c59760d5cdcd0546513..faee5e3c56cc19a5419a4b6b704311c98a824c0a 100644 (file)
@@ -5,24 +5,35 @@
 depend() {
        need net
        # In order to properly support this (need vs use), we would have to
-       # parse ${MEDIATOMB_CONFIG} and see if mysql is enabled and if it is
+       # parse ${GERBERA_CONFIG} and see if mysql is enabled and if it is
        # pointing to the local system.  #368409
        use mysql
 }
 
 start() {
-       ebegin "Starting MediaTomb"
-       start-stop-daemon --start --quiet --exec /usr/bin/mediatomb \
-               --pidfile ${MEDIATOMB_PIDFILE} -- --daemon \
-               --pidfile ${MEDIATOMB_PIDFILE} --user ${MEDIATOMB_USER} \
-               --group ${MEDIATOMB_GROUP} --logfile ${MEDIATOMB_LOGFILE} \
-               --config ${MEDIATOMB_CONFIG} --port ${MEDIATOMB_PORT} \
-               ${MEDIATOMB_OPTIONS}
+       ebegin "Starting Gerbera"
+
+       checkpath --directory --owner "${GERBERA_USER}:${GERBERA_GROUP}" --mode 0755 /run/gerbera
+       checkpath --file --owner "${GERBERA_USER}:${GERBERA_GROUP}" --mode 0644 "${GERBERA_LOGFILE}"
+
+       start-stop-daemon \
+               --start \
+               --exec /usr/bin/gerbera \
+               --user ${GERBERA_USER} \
+               --group ${GERBERA_GROUP} \
+               --background \
+               --wait 500 \
+               -- \
+               --pidfile /run/gerbera/gerbera.pid \
+               --logfile ${GERBERA_LOGFILE} \
+               --config ${GERBERA_CONFIG} \
+               --port ${GERBERA_PORT} \
+               ${GERBERA_OPTIONS}
        eend $?
 }
 
 stop () {
-       ebegin "Stopping MediaTomb"
-       start-stop-daemon --stop --retry 10 --quiet --pidfile ${MEDIATOMB_PIDFILE}
+       ebegin "Stopping Gerbera"
+       start-stop-daemon --stop --retry 10 --quiet --pidfile /run/gerbera/gerbera.pid
        eend $?
 }
diff --git a/net-misc/gerbera/files/gerbera.tmpfiles b/net-misc/gerbera/files/gerbera.tmpfiles
new file mode 100644 (file)
index 0000000..fcc9b5d
--- /dev/null
@@ -0,0 +1 @@
+d /run/gerbera 0755 gerbera gerbera -
\ No newline at end of file
similarity index 95%
rename from net-misc/gerbera/gerbera-1.0.0.ebuild
rename to net-misc/gerbera/gerbera-1.0.0-r1.ebuild
index 6b6892239b6536550383f35326314bd73bd6f136..6202d227a4d6c76b4969db4b54282a51380aba61 100644 (file)
@@ -3,7 +3,7 @@
 
 EAPI=6
 
-inherit cmake-utils eutils linux-info systemd user
+inherit cmake-utils eutils linux-info systemd tmpfiles user
 
 if [[ ${PV} == 9999 ]]; then
        EGIT_REPO_URI="https://github.com/v00d00/${PN}.git"
@@ -88,6 +88,8 @@ src_install() {
 
        keepdir /var/lib/${PN}
        fowners ${PN}:${PN} /var/lib/${PN}
+
+       newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf
 }
 
 pkg_postinst() {
index 6b6892239b6536550383f35326314bd73bd6f136..6202d227a4d6c76b4969db4b54282a51380aba61 100644 (file)
@@ -3,7 +3,7 @@
 
 EAPI=6
 
-inherit cmake-utils eutils linux-info systemd user
+inherit cmake-utils eutils linux-info systemd tmpfiles user
 
 if [[ ${PV} == 9999 ]]; then
        EGIT_REPO_URI="https://github.com/v00d00/${PN}.git"
@@ -88,6 +88,8 @@ src_install() {
 
        keepdir /var/lib/${PN}
        fowners ${PN}:${PN} /var/lib/${PN}
+
+       newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf
 }
 
 pkg_postinst() {