saving uncommitted changes in /etc prior to emerge run

This commit is contained in:
hasufell 2015-09-15 16:35:15 +02:00 committed by Hans Wurst
parent 547e9c3889
commit 5987a8836c
2 changed files with 64 additions and 0 deletions

24
conf.d/znc Normal file
View File

@ -0,0 +1,24 @@
# /etc/conf.d/znc
# Location of the znc configuration folder
ZNC_DATADIR="/var/lib/znc"
# User to run znc as
ZNC_USER="znc"
# Group to run znc as
ZNC_GROUP="znc"
# PID file
ZNC_PIDFILE="/run/znc/znc.pid"
# You can use this configuration option to pass additional options to the
# start-stop-daemon, see start-stop-daemon(8) for more details.
# Per default we wait 1000ms after we have started the service to ensure
# that the daemon is really up and running.
ZNC_SSDARGS="--wait 1000"
# The termination timeout (start-stop-daemon parameter "retry") ensures
# that the service will be terminated within a given time (30 + 5 seconds
# per default) when you are stopping the service.
ZNC_TERMTIMEOUT="TERM/30/KILL/5"

40
init.d/znc Executable file
View File

@ -0,0 +1,40 @@
#!/sbin/runscript
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
extra_commands="config"
extra_started_commands="reload save"
command="/usr/bin/znc"
command_args="--datadir \"${ZNC_DATADIR}\""
pidfile="${ZNC_PIDFILE:-/run/znc/znc.pid}"
user=${ZNC_USER:-znc}
group=${ZNC_GROUP:-znc}
start_stop_daemon_args="--chdir \"${ZNC_DATADIR}\" --user ${user} --group ${group} ${ZNC_SSDARGS}"
retry="${ZNC_TERMTIMEOUT}"
required_dirs="${ZNC_DATADIR}"
depend() {
use dns logger
}
start_pre() {
checkpath -d -m 0770 -o ${user}:${group} "$(dirname ${pidfile})"
}
stop_post() {
rm "${pidfile}"
}
reload() {
ebegin "Reloading ZNC Configuration File from Disk"
start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
eend $?
}
save() {
ebegin "Saving ZNC Configuration File to Disk"
start-stop-daemon --signal SIGUSR1 --pidfile "${pidfile}"
eend $?
}