diff --git a/net-p2p/syncthing/ChangeLog b/net-p2p/syncthing/ChangeLog index 2fe76cd..706cf61 100644 --- a/net-p2p/syncthing/ChangeLog +++ b/net-p2p/syncthing/ChangeLog @@ -1,3 +1,6 @@ + 13 Jan 2016; +files/syncthing: + net-p2p/syncthing: added syncthing launcher file + *syncthing-0.12.12 (13 Jan 2016) 13 Jan 2016; +syncthing-0.12.12.ebuild: diff --git a/net-p2p/syncthing/files/syncthing b/net-p2p/syncthing/files/syncthing new file mode 100644 index 0000000..34f133c --- /dev/null +++ b/net-p2p/syncthing/files/syncthing @@ -0,0 +1,30 @@ +#!/sbin/runscript +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +SVCUSER=${SVCNAME#*.} +pid_file="/run/syncthing-${SVCUSER}/syncthing.pid" + +depend() { + need net + provide syncthing +} + +start_pre() { + checkpath -d -m 0775 -o ${SVCUSER}:${SVCUSER} /run/syncthing-${SVCUSER} +} + +start() { + ebegin "Starting Syncthing" + start-stop-daemon --start --make-pidfile --pidfile ${pid_file} \ + --user ${SVCUSER} --group ${SVCUSER} --background --exec /usr/bin/syncthing -- +-no-browser + eend $? +} + +stop() { + ebegin "Stopping Syncthing" + start-stop-daemon --stop --pidfile ${pid_file} + eend $? +}