From 40cae1a8612ee80e1c6f8b0f2dc4f6a63a907f2c Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Wed, 13 Jan 2016 19:28:59 +0100 Subject: [PATCH] net-p2p/bittorrent-sync: added service/config files from pigfoot to correct ebuild Package-Manager: portage-2.2.26 --- net-p2p/bittorrent-sync/ChangeLog | 5 ++ net-p2p/bittorrent-sync/files/btsync.conf | 20 +++++++ net-p2p/bittorrent-sync/files/btsync.confd | 19 ------ net-p2p/bittorrent-sync/files/btsync.initd | 58 ------------------- net-p2p/bittorrent-sync/files/init.d/btsync | 44 ++++++++++++++ .../files/systemd/btsync.service | 14 +++++ 6 files changed, 83 insertions(+), 77 deletions(-) create mode 100644 net-p2p/bittorrent-sync/files/btsync.conf delete mode 100644 net-p2p/bittorrent-sync/files/btsync.confd delete mode 100644 net-p2p/bittorrent-sync/files/btsync.initd create mode 100644 net-p2p/bittorrent-sync/files/init.d/btsync create mode 100644 net-p2p/bittorrent-sync/files/systemd/btsync.service diff --git a/net-p2p/bittorrent-sync/ChangeLog b/net-p2p/bittorrent-sync/ChangeLog index a215e17..2160b37 100644 --- a/net-p2p/bittorrent-sync/ChangeLog +++ b/net-p2p/bittorrent-sync/ChangeLog @@ -1,3 +1,8 @@ + 13 Jan 2016; +files/btsync.conf, +files/init.d/btsync, + +files/systemd/btsync.service, -files/btsync.confd, -files/btsync.initd: + net-p2p/bittorrent-sync: added service/config files from pigfoot to correct + ebuild + *bittorrent-sync-1.4.110 (13 Jan 2016) 13 Jan 2016; +bittorrent-sync-1.4.110.ebuild, diff --git a/net-p2p/bittorrent-sync/files/btsync.conf b/net-p2p/bittorrent-sync/files/btsync.conf new file mode 100644 index 0000000..6a4a5a9 --- /dev/null +++ b/net-p2p/bittorrent-sync/files/btsync.conf @@ -0,0 +1,20 @@ +{ + "device_name": "Gentoo", + "listening_port" : 0, + + "storage_path" : "/var/lib/btsync", + "pid_file" : "/var/run/btsync/btsync.pid", + + "check_for_updates" : true, + "use_upnp" : true, + + "download_limit" : 0, + "upload_limit" : 0, + + "webui" : + { + "listen" : "127.0.0.1:8888", + "login" : "admin", + "password" : "admin" + } +} diff --git a/net-p2p/bittorrent-sync/files/btsync.confd b/net-p2p/bittorrent-sync/files/btsync.confd deleted file mode 100644 index 8840a71..0000000 --- a/net-p2p/bittorrent-sync/files/btsync.confd +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -# DO NOT MODIFY THIS FILE DIRECTLY! CREATE A COPY AND MODIFY THAT INSTEAD! - -# User and group of the user that will run the instance. -BTSYNC_USER= -BTSYNC_GROUP= - -# Configuration file. Create it with "btsync --dump-sample-config" and edit. -# If not set, default settings will be applied. -#BTSYNC_CONFIG= - -# Directory where the instance will be started. Defaults to / -#BTSYNC_DIR=/ - -# Extra options to be added to the btsync call. -#BTSYNC_EXTRA_OPTIONS= diff --git a/net-p2p/bittorrent-sync/files/btsync.initd b/net-p2p/bittorrent-sync/files/btsync.initd deleted file mode 100644 index f343ff1..0000000 --- a/net-p2p/bittorrent-sync/files/btsync.initd +++ /dev/null @@ -1,58 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -BTSYNC_EXEC="/opt/bin/btsync" -PROGNAME=${SVCNAME#*.} -PIDPATH="/var/run/btsync" -PIDFILE="${PIDPATH}/${SVCNAME}.pid" - -depend() { - need net -} - -start() { - local OPTIONS="--nodaemon" - - if [ "${SVCNAME}" = "btsync" ]; then - eerror "You are not supposed to run this script directly. Create a symlink" - eerror "for the BitTorrent Sync instance you want to run as well as a copy" - eerror "of the ration file and modify it appropriately like so..." - eerror - eerror " # ln -s btsync /etc/init.d/btsync.home" - eerror " # cp /etc/conf.d/btsync /etc/conf.d/btsync.home" - eerror " # nano /etc/conf.d/btsync.home" - eerror - return 1 - fi - - if [ -z "${BTSYNC_USER}" ] || [ -z "${BTSYNC_GROUP}" ]; then - eerror "You should specify an user and group:" - eerror " BTSYNC_USER=user" - eerror " BTSYNC_GROUP=group" - return 1 - fi - - if [ -n "${BTSYNC_CONFIG}" ]; then - OPTIONS="${OPTIONS} --config ${BTSYNC_CONFIG}" - fi - - if [ -n "${BTSYNC_EXTRA_OPTIONS}" ]; then - OPTIONS="${OPTIONS} ${BTSYNC_EXTRA_OPTIONS}" - fi - - ebegin "Starting BitTorrent Sync instance ${PROGNAME}" - checkpath -d -m 0750 -o "${BTSYNC_USER}":"${BTSYNC_GROUP}" "${PIDPATH}" - cd "${BTSYNC_DIR:-/}" && \ - start-stop-daemon --start --user "${BTSYNC_USER}" --group "${BTSYNC_GROUP}" \ - --pidfile "${PIDFILE}" --background --make-pidfile --exec "${BTSYNC_EXEC}" \ - -- ${OPTIONS} - eend $? -} - -stop() { - ebegin "Stopping BitTorrent Sync instance ${PROGNAME}" - start-stop-daemon --stop --pidfile "${PIDFILE}" - eend $? -} diff --git a/net-p2p/bittorrent-sync/files/init.d/btsync b/net-p2p/bittorrent-sync/files/init.d/btsync new file mode 100644 index 0000000..9e7cd3d --- /dev/null +++ b/net-p2p/bittorrent-sync/files/init.d/btsync @@ -0,0 +1,44 @@ +#!/sbin/runscript + +# Copyright 2013-2014 Jonathan Vasquez +# Distributed under the terms of the GNU General Public License v2 + +NAME="BitTorrent Sync" +SYNC_NAME="btsync" +SYNC_PATH="/opt/${SYNC_NAME}/" +SYNC_BINARY="${SYNC_PATH}/${SYNC_NAME}" +SYNC_OPTS="--nodaemon --config /etc/${SYNC_NAME}/btsync.conf" +SYNC_PIDFILE="/var/run/${SYNC_NAME}/${SYNC_NAME}.pid" +SYNC_USER=${SYNC_USER:-btsync} +SYNC_GROUP=${SYNC_GROUP:-btsync} + +start() { + ebegin "Starting ${NAME}" + + # Sets the umask for the process so that btsync creates files + # with group write permissions + start-stop-daemon --start --exec "${SYNC_BINARY}" \ + --pidfile "${SYNC_PIDFILE}" --background \ + --user "${SYNC_USER}" --group "${SYNC_GROUP}" \ + -- ${SYNC_OPTS} + + eend $? +} + +stop() { + ebegin "Stopping ${NAME}" + + start-stop-daemon --stop --exec "${SYNC_BINARY}" \ + --pidfile "${SYNC_PIDFILE}" + + eend $? +} + +reload() { + ebegin "Reloading ${NAME}" + + start-stop-daemon --signal HUP --exec "${SYNC_BINARY}" \ + --pidfile "${SYNC_PIDFILE}" + + eend $? +} diff --git a/net-p2p/bittorrent-sync/files/systemd/btsync.service b/net-p2p/bittorrent-sync/files/systemd/btsync.service new file mode 100644 index 0000000..09554e6 --- /dev/null +++ b/net-p2p/bittorrent-sync/files/systemd/btsync.service @@ -0,0 +1,14 @@ +# Copyright 2014-2016 Jonathan Vasquez +# Distributed under the terms of the GNU General Public License v2 + +[Unit] +Description=BitTorrent Sync +After=systemd-udev-settle.target local-fs.target zfs.service + +[Service] +Type=forking +ExecStart=/opt/btsync/btsync --config /etc/btsync/config + +[Install] +WantedBy=multi-user.target +