#!/sbin/runscript # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ : ${pidfile:=/run/${RC_SVCNAME}.pid} : ${LSYNCD_CONFIG_FILE:=/etc/lsyncd.conf} : ${LSYNCD_USER:=nobody} depend() { after bootmisc use logger } checkconfig() { if [[ ! -f "${LSYNCD_CONFIG_FILE}" ]] ; then eerror "File ${LSYNCD_CONFIG_FILE} is missing" eerror "See sample in /usr/share/lsyncd*/" return 1 fi checkpath -f \ -o "${LSYNCD_USER}" \ "${pidfile}" \ || return 1 return 0 } start() { checkconfig || return $? ebegin "Starting ${RC_SVCNAME}" start-stop-daemon --start \ --user "${LSYNCD_USER}" \ --exec /usr/bin/lsyncd \ --pidfile "${pidfile}" \ -- \ -pidfile "${pidfile}" \ ${LSYNCD_OPTS} \ "${LSYNCD_CONFIG_FILE}" eend $? } stop() { ebegin "Stopping ${RC_SVCNAME}" start-stop-daemon --stop \ --pidfile "${pidfile}" eend $? }