1
0
mirror of synced 2024-12-22 12:50:33 +01:00

Conform to Gentoo ebuild packaging guidelines

This commit is contained in:
bobwya 2014-06-23 22:10:50 +01:00
parent 6015de186c
commit dcc3cc445c
6 changed files with 56 additions and 52 deletions

View File

@ -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]

View File

@ -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]

View 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 $?
}

View File

@ -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]

View File

@ -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 $?
}