summaryrefslogtreecommitdiff
path: root/pcr/yacy-openrc/yacy
blob: 1f5d125fd45f176b6dbfe349d86c277ed4f2106e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 $?
}