diff options
author | Ultrabug <ultrabug@gentoo.org> | 2016-06-01 08:41:03 +0200 |
---|---|---|
committer | Ultrabug <ultrabug@gentoo.org> | 2016-06-01 08:41:03 +0200 |
commit | 10547a21006ad786ea3d365764056871d43508d2 (patch) | |
tree | 4680224510778e7d7793fea9e38175378a7fcc2b /app-admin/nxlog-ce/files | |
parent | improved rethinkdb ebuild with enhanced config from bgo overlay (diff) | |
download | ultrabug-10547a21006ad786ea3d365764056871d43508d2.tar.gz ultrabug-10547a21006ad786ea3d365764056871d43508d2.tar.bz2 ultrabug-10547a21006ad786ea3d365764056871d43508d2.zip |
app-admin/nxlog-ce: new ebuild
Diffstat (limited to 'app-admin/nxlog-ce/files')
-rw-r--r-- | app-admin/nxlog-ce/files/nxlog.initd | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/app-admin/nxlog-ce/files/nxlog.initd b/app-admin/nxlog-ce/files/nxlog.initd new file mode 100644 index 0000000..33490e3 --- /dev/null +++ b/app-admin/nxlog-ce/files/nxlog.initd @@ -0,0 +1,45 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +config_file=${config_file:-/etc/nxlog/${SVCNAME}.conf} +run_dir=${run_dir:-/run/nxlog} + +command="/usr/bin/nxlog" +command_args="-c ${config_file}" +pidfile=${run_dir}/${SVCNAME}.pid +user=${user:-nxlog} +group=${group:-nxlog} + +extra_started_commands="${opts} reload" + +depend() { + use net +} + +check_config() { + ${command} ${command_args} -v >/dev/null + return $? +} + +start_pre() { + checkpath -d -m 0750 -o "${user}":"${group}" "${run_dir}" + if [ ! -f ${config_file} ]; then + eerror "Missing configuration file ${config_file}" + return 1 + fi + check_config + return $? +} + +reload() { + ebegin "Reloading ${SVCNAME}" + check_config + if [ $? == 0 ]; then + ${command} ${command_args} -r + eend $? + else + eend 1 + fi +} |