diff options
author | Louis Sautier <sautier.louis@gmail.com> | 2016-02-17 15:01:29 +0100 |
---|---|---|
committer | Dirkjan Ochtman <djc@gentoo.org> | 2016-02-17 21:33:20 +0100 |
commit | c7c80deec9e3adf001a7a47dafada47afef3ff04 (patch) | |
tree | a2612033e99653e5f7d6324076f79c92f1dfd2cf /net-p2p/syncthing/files | |
parent | f2c0c656d65212cb71ec10a27224d37ae5b5c3f8 (diff) | |
download | gentoo-c7c80deec9e3adf001a7a47dafada47afef3ff04.tar.gz gentoo-c7c80deec9e3adf001a7a47dafada47afef3ff04.tar.xz |
net-p2p/syncthing: add init script, man, logrotate
Package-Manager: portage-2.2.27
Diffstat (limited to 'net-p2p/syncthing/files')
-rw-r--r-- | net-p2p/syncthing/files/syncthing.confd | 24 | ||||
-rwxr-xr-x | net-p2p/syncthing/files/syncthing.initd | 34 | ||||
-rw-r--r-- | net-p2p/syncthing/files/syncthing.logrotate | 9 |
3 files changed, 67 insertions, 0 deletions
diff --git a/net-p2p/syncthing/files/syncthing.confd b/net-p2p/syncthing/files/syncthing.confd new file mode 100644 index 00000000000..da3ac4d2bbf --- /dev/null +++ b/net-p2p/syncthing/files/syncthing.confd @@ -0,0 +1,24 @@ +# /etc/conf.d/syncthing: config file for /etc/init.d/syncthing + +# User and group as which to run +#SYNCTHING_USER="syncthing" +#SYNCTHING_GROUP="syncthing" + +# Configuration directory +#SYNCTHING_HOMEDIR="/var/lib/syncthing" + +# Log file location +#SYNCTHING_LOGFILE="/var/log/syncthing/syncthing.log" + +# umask used to create files +# The default allows group access +#SYNCTHING_UMASK=007 + +# I/O nice level of syncthing +#SYNCTHING_IONICE="0" + +# Nice level of syncthing +#SYNCTHING_NICE="0" + +# Extra options for syncthing +#SYNCTHING_OPTS="" diff --git a/net-p2p/syncthing/files/syncthing.initd b/net-p2p/syncthing/files/syncthing.initd new file mode 100755 index 00000000000..2acaf3420f3 --- /dev/null +++ b/net-p2p/syncthing/files/syncthing.initd @@ -0,0 +1,34 @@ +#!/sbin/runscript +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +SYNCTHING_USER=${SYNCTHING_USER:-syncthing} +SYNCTHING_GROUP=${SYNCTHING_GROUP:-syncthing} +SYNCTHING_HOMEDIR=${SYNCTHING_HOMEDIR:-/var/lib/syncthing} +SYNCTHING_LOGFILE=${SYNCTHING_LOGFILE:-/var/log/syncthing/syncthing.log} +SYNCTHING_UMASK=${SYNCTHING_UMASK:-007} +SYNCTHING_IONICE=${SYNCTHING_IONICE:-0} +SYNCTHING_NICE=${SYNCTHING_NICE:-0} + +description="Syncthing is an open, trustworthy and decentralized cloud storage system" +command="/usr/bin/syncthing" +command_args="-no-browser -home=${SYNCTHING_HOMEDIR} ${SYNCTHING_OPTS}" +pidfile="/run/syncthing.pid" +start_stop_daemon_args="--background \ + --user ${SYNCTHING_USER} \ + --group ${SYNCTHING_GROUP} \ + --umask ${SYNCTHING_UMASK} \ + --make-pidfile \ + --ionice ${SYNCTHING_IONICE} \ + --nicelevel ${SYNCTHING_NICE} \ + --stdout ${SYNCTHING_LOGFILE} \ + --stderr ${SYNCTHING_LOGFILE}" + +depend() { + need localmount net +} + +start_pre() { + checkpath -q -d -o ${SYNCTHING_USER}:${SYNCTHING_GROUP} ${SYNCTHING_HOMEDIR} + checkpath -q -f -o ${SYNCTHING_USER}:${SYNCTHING_GROUP} ${SYNCTHING_LOGFILE} +} diff --git a/net-p2p/syncthing/files/syncthing.logrotate b/net-p2p/syncthing/files/syncthing.logrotate new file mode 100644 index 00000000000..37c43209a12 --- /dev/null +++ b/net-p2p/syncthing/files/syncthing.logrotate @@ -0,0 +1,9 @@ +/var/log/syncthing/syncthing.log { + missingok + notifempty + sharedscripts + postrotate + kill -0 $(</run/syncthing.pid) && \ + /etc/init.d/syncthing restart > /dev/null 2>&1 || true + endscript +} |