Conform to Gentoo ebuild packaging guidelines
This commit is contained in:
parent
6015de186c
commit
dcc3cc445c
@ -8,7 +8,8 @@ IOSchedulingClass=idle
|
||||
IOSchedulingPriority=7
|
||||
User=btsync
|
||||
Group=btsync
|
||||
ExecStart=/opt/btsync/btsync --config /etc/btsync.conf --nodaemon
|
||||
ExecStartPre=/opt/btsync/bin/btsync_setup
|
||||
ExecStart=/opt/btsync/bin/btsync --config /etc/btsync.conf --nodaemon
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
|
@ -7,7 +7,8 @@ Nice=19
|
||||
IOSchedulingClass=idle
|
||||
IOSchedulingPriority=7
|
||||
User=%i
|
||||
ExecStart=/opt/btsync/btsync --config /home/%i/.config/btsync/btsync.conf --nodaemon
|
||||
ExecStartPre=/opt/btsync/bin/btsync_setup
|
||||
ExecStart=/opt/btsync/bin/btsync --config /home/%i/.btsync/btsync.conf --nodaemon
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
49
net-p2p/btsync/files/btsync_initd
Normal file
49
net-p2p/btsync/files/btsync_initd
Normal file
@ -0,0 +1,49 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright (C) 2013 Jonathan Vasquez <jvasquez1011@gmail.com>
|
||||
# Distributed under the terms of the Simplified BSD License.
|
||||
|
||||
BTSYNC_NAME="btsync"
|
||||
BTSYNC_PATH="/opt/${BTSYNC_NAME}/"
|
||||
BTSYNC_BINARY="${BTSYNC_PATH}/bin/${BTSYNC_NAME}"
|
||||
BTSYNC_PIDFOLDER="/run/${BTSYNC_NAME}"
|
||||
BTSYNC_PIDFILE="${BTSYNC_PIDFOLDER}/${BTSYNC_NAME}.pid"
|
||||
|
||||
depend() {
|
||||
need localmount net
|
||||
after bootmisc
|
||||
}
|
||||
|
||||
start() {
|
||||
if [ ! -d "${BTSYNC_PIDFOLDER}" ]; then
|
||||
mkdir "${BTSYNC_PIDFOLDER}"
|
||||
chown "${BTSYNC_USER}:${BTSYNC_GROUP}" "${BTSYNC_PIDFOLDER}"
|
||||
fi
|
||||
|
||||
ebegin "Starting ${BTSYNC_NAME}"
|
||||
start-stop-daemon \
|
||||
--start \
|
||||
--pidfile "${BTSYNC_PIDFILE}" \
|
||||
--user "${BTSYNC_USER}" \
|
||||
--group "${BTSYNC_GROUP}" \
|
||||
--exec "${BTSYNC_BINARY}" \
|
||||
-- --config "/etc/btsync.conf"
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping ${BTSYNC_NAME}"
|
||||
|
||||
start-stop-daemon --stop --exec "${BTSYNC_BINARY}" \
|
||||
--pidfile "${BTSYNC_PIDFILE}"
|
||||
|
||||
eend $?
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "Reloading ${BTSYNC_NAME}"
|
||||
|
||||
start-stop-daemon --signal HUP --exec "${BTSYNC_BINARY}" \
|
||||
--pidfile "${BTSYNC_PIDFILE}"
|
||||
|
||||
eend $?
|
||||
}
|
@ -4,9 +4,10 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Nice=19
|
||||
IOSchedulingClass=idle
|
||||
IOSchedulingClass=idle
|
||||
IOSchedulingPriority=7
|
||||
ExecStart=/opt/btsync/btsync --config %h/.config/btsync/btsync.conf --nodaemon
|
||||
ExecStartPre=/opt/btsync/bin/btsync_setup
|
||||
ExecStart=/opt/btsync/bin/btsync --config %h/.btsync/btsync.conf --nodaemon
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
|
@ -1,48 +0,0 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright (C) 2013 Jonathan Vasquez <jvasquez1011@gmail.com>
|
||||
# Distributed under the terms of the Simplified BSD License.
|
||||
|
||||
SYNC_NAME="btsync"
|
||||
SYNC_PATH="/opt/${SYNC_NAME}/"
|
||||
SYNC_BINARY="${SYNC_PATH}/${SYNC_NAME}"
|
||||
SYNC_PIDFILE="/var/run/${SYNC_NAME}.pid"
|
||||
|
||||
depend() {
|
||||
need localmount net
|
||||
after bootmisc
|
||||
}
|
||||
|
||||
start() {
|
||||
if [ ! -d /run/btsync ]; then
|
||||
mkdir /run/btsync
|
||||
chown "${BTSYNC_USER}:${BTSYNC_GROUP}" /run/btsync
|
||||
fi
|
||||
|
||||
ebegin "Starting ${SYNC_NAME}"
|
||||
start-stop-daemon \
|
||||
--start \
|
||||
--pidfile "${PIDFILE}" \
|
||||
--user "${BTSYNC_USER}" \
|
||||
--group "${BTSYNC_GROUP}" \
|
||||
--exec "${SYNC_BINARY}" \
|
||||
-- --config "/etc/btsync.conf"
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping ${SYNC_NAME}"
|
||||
|
||||
start-stop-daemon --stop --exec "${SYNC_BINARY}" \
|
||||
--pidfile "${SYNC_PIDFILE}"
|
||||
|
||||
eend $?
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "Reloading ${SYNC_NAME}"
|
||||
|
||||
start-stop-daemon --signal HUP --exec "${SYNC_BINARY}" \
|
||||
--pidfile "${SYNC_PIDFILE}"
|
||||
|
||||
eend $?
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user