diff options
author | Louis Sautier <sautier.louis@gmail.com> | 2017-10-04 12:11:42 +0200 |
---|---|---|
committer | Sven Wegener <swegener@gentoo.org> | 2017-10-05 21:35:44 +0000 |
commit | 2b41864cd150b5dd1c5c45478c287ec87676f6e3 (patch) | |
tree | d26c595c3577d483b337b07537e245e75d53328f /net-nntp/nzbget/files | |
parent | app-backup/mirdir: clean up old. (diff) | |
download | gentoo-2b41864cd150b5dd1c5c45478c287ec87676f6e3.tar.gz gentoo-2b41864cd150b5dd1c5c45478c287ec87676f6e3.tar.bz2 gentoo-2b41864cd150b5dd1c5c45478c287ec87676f6e3.zip |
net-nntp/nzbget: improve init script to use a pid file, add depend
It seems that the older behaviour did not work with recent openrc
versions. The process could not be found when running the stop command.
We don't need to override LockFile in the configuration file any more
since we set it when we start the daemon.
Package-Manager: Portage-2.3.8, Repoman-2.3.3
[swegener: separate init script revision]
Diffstat (limited to 'net-nntp/nzbget/files')
-rw-r--r-- | net-nntp/nzbget/files/nzbget.initd-r1 | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/net-nntp/nzbget/files/nzbget.initd-r1 b/net-nntp/nzbget/files/nzbget.initd-r1 new file mode 100644 index 000000000000..2a9fae6c32b4 --- /dev/null +++ b/net-nntp/nzbget/files/nzbget.initd-r1 @@ -0,0 +1,28 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_started_commands="reload" + +description="A command-line based binary newsgrabber supporting .nzb files" +pidfile=/run/nzbget/nzbget.pid +command=/usr/bin/nzbget +command_args="--configfile \"${NZBGET_CONFIGFILE}\" \ + --daemon --option LockFile=${pidfile} \ + ${NZBGET_OPTS}" +start_stop_daemon_args="--user \"${NZBGET_USER}\" \ + --group \"${NZBGET_GROUP}\"" + +depend() { + need localmount net +} + +start_pre() { + checkpath -d -m 0755 -o "${NZBGET_USER}":"${NZBGET_GROUP}" /run/nzbget +} + +reload() { + ebegin "Reloading ${RC_SVCNAME}" + ${command} --configfile "${NZBGET_CONFIGFILE}" --reload >/dev/null + eend $? +} |