diff options
Diffstat (limited to 'net-p2p/automatic/files')
-rw-r--r-- | net-p2p/automatic/files/automatic.confd | 8 | ||||
-rw-r--r-- | net-p2p/automatic/files/automatic.initd | 36 | ||||
-rw-r--r-- | net-p2p/automatic/files/automatic.logrotate | 8 |
3 files changed, 52 insertions, 0 deletions
diff --git a/net-p2p/automatic/files/automatic.confd b/net-p2p/automatic/files/automatic.confd new file mode 100644 index 00000000000..5e9ae5d6962 --- /dev/null +++ b/net-p2p/automatic/files/automatic.confd @@ -0,0 +1,8 @@ +# Config file for /etc/init.d/automatic + +# Various options. +# run `samplicator -h` for valid cmdline options +OPTS="-v 1 -a -l /var/log/automatic/automatic.log" + +# Receiver config file +CONFIG="-c /etc/automatic.conf" diff --git a/net-p2p/automatic/files/automatic.initd b/net-p2p/automatic/files/automatic.initd new file mode 100644 index 00000000000..a5c6189b56b --- /dev/null +++ b/net-p2p/automatic/files/automatic.initd @@ -0,0 +1,36 @@ +#!/sbin/openrc-run + +NAME=${SVCNAME##*.} +if [ -n "${NAME}" -a "${SVCNAME}" != "automatic" ]; then + PID="/run/automatic.${NAME}.pid" + PNAME=$(echo ${RC_SVCNAME} | sed 's/\..*//g') + CONF_DEFAULT="/etc/conf.d/automatic.${NAME}" +else + PID="/run/automatic.pid" + PNAME=${RC_SVCNAME} + CONF_DEFAULT="/etc/conf.d/automatic" +fi +CONF=${CONF:-${CONF_DEFAULT}} +EXEC=${EXEC:-/usr/bin/automatic} + +depend() { + need net + provide automatic +} + +start() { + ebegin "Starting automatic" + start-stop-daemon --start --quiet --make-pidfile --pidfile ${PID} --exec ${EXEC} -- ${OPTS} ${CONFIG} + eend $? +} + +start_post() { + pgrep -n $(echo ${PNAME}) > ${PID} +} + +stop() { + ebegin "Stopping automatic" + start-stop-daemon --stop --quiet --pidfile ${PID} + rm -f ${PID} + eend $? +} diff --git a/net-p2p/automatic/files/automatic.logrotate b/net-p2p/automatic/files/automatic.logrotate new file mode 100644 index 00000000000..1af9c5c57cb --- /dev/null +++ b/net-p2p/automatic/files/automatic.logrotate @@ -0,0 +1,8 @@ +/var/log/automatic/*.log { + daily + missingok + rotate 90 + compress + notifempty + copytruncate +} |