summaryrefslogtreecommitdiff
path: root/app-misc/g15composer/files/g15composer-3.1.initd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-misc/g15composer/files/g15composer-3.1.initd
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-misc/g15composer/files/g15composer-3.1.initd')
-rw-r--r--app-misc/g15composer/files/g15composer-3.1.initd48
1 files changed, 48 insertions, 0 deletions
diff --git a/app-misc/g15composer/files/g15composer-3.1.initd b/app-misc/g15composer/files/g15composer-3.1.initd
new file mode 100644
index 000000000000..0d7c24f85609
--- /dev/null
+++ b/app-misc/g15composer/files/g15composer-3.1.initd
@@ -0,0 +1,48 @@
+#!/sbin/openrc-run
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+PIDFILE=/var/run/${SVCNAME}.pid
+
+depend() {
+ need g15daemon
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+
+ if [ -z "${FIFO_USER}" -o -z "${FIFO_GROUP}" ] ; then
+ eerror "Please set the FIFO_USER and FIFO_GROUP variables in /etc/conf.d/${SVCNAME}"
+ eend 1
+ return 1
+ fi
+ if [ -e "${CONTROL_FIFO}" -a ! -p "${CONTROL_FIFO}" ] ; then
+ eerror "${CONTROL_FIFO} exists and is not a FIFO. Please remove."
+ eend 1
+ return 1
+ fi
+ if [ ! -p "${CONTROL_FIFO}" ] ; then
+ einfo "Creating FIFO at ${CONTROL_FIFO}"
+ mkfifo -m660 "${CONTROL_FIFO}"
+ else
+ einfo "Reusing FIFO at ${CONTROL_FIFO}"
+ fi
+
+ chown ${FIFO_USER} "${CONTROL_FIFO}"
+ chgrp ${FIFO_GROUP} "${CONTROL_FIFO}"
+ start-stop-daemon --start --background --pidfile ${PIDFILE} --make-pidfile --exec \
+ /usr/bin/g15composer -- -b -u "${FIFO_USER}" -g "${FIFO_GROUP}" "${CONTROL_FIFO}"
+ eend $?
+}
+
+stop() {
+ ebegin "Stoping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile ${PIDFILE} --name g15composer
+ if [ -p "${CONTROL_FIFO}" ] ; then
+ einfo "Removing FIFO at ${CONTROL_FIFO}"
+ rm -f "${CONTROL_FIFO}"
+ else
+ ewarn "FIFO at ${CONTROL_FIFO} was lost"
+ fi
+ eend $?
+}