summaryrefslogtreecommitdiff
path: root/net-p2p/automatic/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-p2p/automatic/files
reinit the tree, so we can have metadata
Diffstat (limited to 'net-p2p/automatic/files')
-rw-r--r--net-p2p/automatic/files/automatic.confd8
-rw-r--r--net-p2p/automatic/files/automatic.initd36
-rw-r--r--net-p2p/automatic/files/automatic.logrotate8
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 000000000000..5e9ae5d69625
--- /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 000000000000..a5c6189b56b1
--- /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 000000000000..1af9c5c57cbc
--- /dev/null
+++ b/net-p2p/automatic/files/automatic.logrotate
@@ -0,0 +1,8 @@
+/var/log/automatic/*.log {
+ daily
+ missingok
+ rotate 90
+ compress
+ notifempty
+ copytruncate
+}