summaryrefslogtreecommitdiff
path: root/pcr/yacy-openrc/yacy
diff options
context:
space:
mode:
authorBruno Cichon <ebrasca.ebrasca@openmailbox.org>2016-08-18 21:06:02 +0200
committerBruno Cichon <ebrasca.ebrasca@openmailbox.org>2016-08-18 21:06:02 +0200
commit13fed92262be920448d20119b891164fb04397e6 (patch)
tree4474fb0caf119fa36dea37eef4234666dbde4526 /pcr/yacy-openrc/yacy
parentd9ea5495f669654f9b96835fcdbb76a239255544 (diff)
downloadabslibre-13fed92262be920448d20119b891164fb04397e6.tar.gz
abslibre-13fed92262be920448d20119b891164fb04397e6.tar.bz2
abslibre-13fed92262be920448d20119b891164fb04397e6.zip
Add openrc init script for yacy.
Diffstat (limited to 'pcr/yacy-openrc/yacy')
-rwxr-xr-xpcr/yacy-openrc/yacy30
1 files changed, 30 insertions, 0 deletions
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 $?
+}