#!/sbin/openrc-run # Copyright (C) 2013-2014 Jonathan Vasquez # Copyright (C) 2014 Sandy McArthur # Distributed under the terms of the Simplified BSD License. depend() { need localmount net after bootmisc } start() { ebegin "Starting ${NAME}" mkdir -p $(dirname ${SYNC_PIDFILE}) chown ${SYNC_USER}:${SYNC_GROUP} $(dirname ${SYNC_PIDFILE}) start-stop-daemon \ --start \ --user "${SYNC_USER}" \ --group "${SYNC_GROUP}" \ --nice 5 \ --ionice 3 \ --exec "${SYNC_BINARY}" \ -- ${SYNC_OPTS} eend $? } stop() { ebegin "Stopping ${NAME}" start-stop-daemon \ --stop \ --user "${SYNC_USER}" \ --group "${SYNC_GROUP}" \ --exec "${SYNC_BINARY}" \ --wait 5000 \ --retry SIGTERM/5 eend $? }