From 13fed92262be920448d20119b891164fb04397e6 Mon Sep 17 00:00:00 2001 From: Bruno Cichon Date: Thu, 18 Aug 2016 21:06:02 +0200 Subject: Add openrc init script for yacy. --- pcr/yacy-openrc/yacy | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 pcr/yacy-openrc/yacy (limited to 'pcr/yacy-openrc/yacy') diff --git a/pcr/yacy-openrc/yacy b/pcr/yacy-openrc/yacy new file mode 100755 index 000000000..1f5d125fd --- /dev/null +++ b/pcr/yacy-openrc/yacy @@ -0,0 +1,30 @@ +#!/usr/bin/openrc-run + +PIDFile=/opt/yacy/.yacy/yacy.pid +User=yacy + +description="YaCy P2P Web Search" + +depend() { + need net +} + +start() { + ebegin "Starting Yacy" + start-stop-daemon --background --user "${User}" --start --pidfile "${PIDFILE}" --quiet --exec /opt/yacy/yacy start + eend $? +} + +stop() { + ebegin "Stopping Yacy" + start-stop-daemon --stop --pidfile "${PIDFILE}" --quiet --exec /opt/yacy/yacy stop + eend $? +} + +reload() { + ebegin "Reloading Yacy." + start-stop-daemon --stop --pidfile "${PIDFILE}" --quiet --exec /opt/yacy/yacy stop + start-stop-daemon --background --user "${User}" --start --pidfile "${PIDFILE}" --quiet --exec /opt/yacy/yacy start + #/opt/yacy/yacy restart + eend $? +} -- cgit v1.2.3