pushpin: Initial ebuild
Signed-off-by: Stefan Knoblich <stkn@bitplumber.de>
This commit is contained in:
38
net-misc/pushpin/files/pushpin.initd
Normal file
38
net-misc/pushpin/files/pushpin.initd
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
PUSHPIN_USER="${PUSHPIN_USER:-pushpin}"
|
||||
PUSHPIN_GROUP="${PUSHPIN_GROUP:-pushpin}"
|
||||
PUSHPIN_CONFIG="${PUSHPIN_CONFIG:-/etc/pushpin/pushpin.conf}"
|
||||
PUSHPIN_DATA_DIR="${PUSHPIN_DATA_DIR:-/var/lib/pushpin}"
|
||||
PUSHPIN_LOG_DIR="${PUSHPIN_LOG_DIR:-/var/log/pushpin}"
|
||||
|
||||
command="/usr/bin/pushpin"
|
||||
command_args="--config ${PUSHPIN_CONFIG} --logfile \"${PUSHPIN_LOG_DIR}/pushpin.log\""
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="Reload the pushpin configuration"
|
||||
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
command_background="true"
|
||||
start_stop_daemon_args="--user=\"${PUSHPIN_USER}\" --group=\"${PUSHPIN_GROUP}\""
|
||||
|
||||
configtest() {
|
||||
ebegin "Checking configuration file"
|
||||
test -f "${PUSHPIN_CONFIG}"
|
||||
eend $? "Please check configuration for errors"
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath -d -o "${PUSHPIN_USER}:${PUSHPIN_GROUP}" -m750 "${PUSHPIN_DATA_DIR}"
|
||||
checkpath -d -o "${PUSHPIN_USER}:${PUSHPIN_GROUP}" -m750 "${PUSHPIN_LOG_DIR}"
|
||||
configtest || return 1
|
||||
}
|
||||
|
||||
reload() {
|
||||
configtest || return 1
|
||||
ebegin "Refreshing pushpin configuration"
|
||||
start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
|
||||
eend $? "Failed to reload pushpin"
|
||||
}
|
||||
Reference in New Issue
Block a user