alpha-quadrant/net-p2p/resilio-sync/files/initd

42 lines
798 B
Plaintext
Raw Normal View History

2016-10-11 15:45:54 +02:00
#!/sbin/openrc-run
2016-04-25 09:53:42 +02:00
# Copyright (C) 2013-2014 Jonathan Vasquez <fearedbliss@funtoo.org>
# Copyright (C) 2014 Sandy McArthur <Sandy@McArthur.org>
# Distributed under the terms of the Simplified BSD License.
depend() {
need localmount net
after bootmisc
}
start() {
ebegin "Starting ${NAME}"
mkdir -p $(dirname ${SYNC_PIDFILE})
2016-10-11 15:45:54 +02:00
chown ${SYNC_USER}:${SYNC_GROUP} $(dirname ${SYNC_PIDFILE})
2016-04-25 09:53:42 +02:00
start-stop-daemon \
--start \
2016-10-11 15:45:54 +02:00
--user "${SYNC_USER}" \
--group "${SYNC_GROUP}" \
2016-04-25 09:53:42 +02:00
--nice 5 \
--ionice 3 \
--exec "${SYNC_BINARY}" \
-- ${SYNC_OPTS}
eend $?
}
stop() {
ebegin "Stopping ${NAME}"
start-stop-daemon \
--stop \
--user "${BTSYNC_USER}" \
--group "${BTSYNC_GROUP}" \
--exec "${SYNC_BINARY}" \
--wait 5000 \
--retry SIGTERM/5
eend $?
}