commit:     01c9e9d631a356d7da00cae6062b66c0cb805023
Author:     Ian Whyman <thev00d00 <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 17 16:33:47 2017 +0000
Commit:     Ian Whyman <thev00d00 <AT> gentoo <DOT> org>
CommitDate: Sat Jun 17 16:34:03 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01c9e9d6

net-misc/gerbera: Fix init scripts

Fixes #621934

Package-Manager: Portage-2.3.5, Repoman-2.3.2

 net-misc/gerbera/files/gerbera-1.0.0.confd         | 37 ++++++++++------------
 net-misc/gerbera/files/gerbera-1.0.0.initd         | 31 ++++++++++++------
 net-misc/gerbera/files/gerbera.tmpfiles            |  1 +
 ...erbera-1.0.0.ebuild => gerbera-1.0.0-r1.ebuild} |  4 ++-
 net-misc/gerbera/gerbera-9999.ebuild               |  4 ++-
 5 files changed, 45 insertions(+), 32 deletions(-)

diff --git a/net-misc/gerbera/files/gerbera-1.0.0.confd 
b/net-misc/gerbera/files/gerbera-1.0.0.confd
index 7f5c0083025..4c4a4422035 100644
--- a/net-misc/gerbera/files/gerbera-1.0.0.confd
+++ b/net-misc/gerbera/files/gerbera-1.0.0.confd
@@ -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=""

diff --git a/net-misc/gerbera/files/gerbera-1.0.0.initd 
b/net-misc/gerbera/files/gerbera-1.0.0.initd
index 86111395d7d..faee5e3c56c 100644
--- a/net-misc/gerbera/files/gerbera-1.0.0.initd
+++ b/net-misc/gerbera/files/gerbera-1.0.0.initd
@@ -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
index 00000000000..fcc9b5de490
--- /dev/null
+++ b/net-misc/gerbera/files/gerbera.tmpfiles
@@ -0,0 +1 @@
+d /run/gerbera 0755 gerbera gerbera -
\ No newline at end of file

diff --git a/net-misc/gerbera/gerbera-1.0.0.ebuild 
b/net-misc/gerbera/gerbera-1.0.0-r1.ebuild
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 6b6892239b6..6202d227a4d 100644
--- a/net-misc/gerbera/gerbera-1.0.0.ebuild
+++ b/net-misc/gerbera/gerbera-1.0.0-r1.ebuild
@@ -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() {

diff --git a/net-misc/gerbera/gerbera-9999.ebuild 
b/net-misc/gerbera/gerbera-9999.ebuild
index 6b6892239b6..6202d227a4d 100644
--- a/net-misc/gerbera/gerbera-9999.ebuild
+++ b/net-misc/gerbera/gerbera-9999.ebuild
@@ -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() {

Reply via email to