2 changed files with 109 additions and 3 deletions
@ -0,0 +1,65 @@ |
|||||||
|
#!@l_prefix@/bin/openpkg rc |
||||||
|
## |
||||||
|
## rc.piknik -- Run-Commands |
||||||
|
## |
||||||
|
|
||||||
|
%config |
||||||
|
piknik_enable="$openpkg_rc_def" |
||||||
|
piknik_flags="" |
||||||
|
piknik_log_prolog="true" |
||||||
|
piknik_log_epilog="true" |
||||||
|
piknik_log_numfiles="10" |
||||||
|
piknik_log_minsize="1M" |
||||||
|
piknik_log_complevel="9" |
||||||
|
|
||||||
|
%common |
||||||
|
piknik_cfgfile="@l_prefix@/etc/piknik/piknik.toml" |
||||||
|
piknik_pidfile="@l_prefix@/var/piknik/run/piknik.pid" |
||||||
|
piknik_logfile="@l_prefix@/var/piknik/log/piknik.log" |
||||||
|
piknik_signal () { |
||||||
|
[ -f $piknik_pidfile ] && kill -$1 `cat $piknik_pidfile` |
||||||
|
} |
||||||
|
|
||||||
|
%status -u @l_rusr@ -o |
||||||
|
piknik_usable="unknown" |
||||||
|
piknik_active="no" |
||||||
|
rcService piknik enable yes && \ |
||||||
|
piknik_signal 0 && piknik_active="yes" |
||||||
|
echo "piknik_enable=\"$piknik_enable\"" |
||||||
|
echo "piknik_usable=\"$piknik_usable\"" |
||||||
|
echo "piknik_active=\"$piknik_active\"" |
||||||
|
|
||||||
|
%start -u @l_rusr@ |
||||||
|
rcService piknik enable yes || exit 0 |
||||||
|
rcService piknik active yes && exit 0 |
||||||
|
( GOMAXPROCS=32 |
||||||
|
export GOMAXPROCS |
||||||
|
nohup @l_prefix@/bin/piknik \ |
||||||
|
-server \ |
||||||
|
-config "$piknik_cfgfile" \ |
||||||
|
$piknik_flags \ |
||||||
|
</dev/null >>$piknik_logfile 2>&1 & |
||||||
|
echo $! >$piknik_pidfile |
||||||
|
) >/dev/null 2>&1 |
||||||
|
|
||||||
|
%stop -u @l_rusr@ |
||||||
|
rcService piknik enable yes || exit 0 |
||||||
|
rcService piknik active no && exit 0 |
||||||
|
piknik_signal TERM |
||||||
|
sleep 2 |
||||||
|
rm -f $piknik_pidfile >/dev/null 2>&1 || true |
||||||
|
|
||||||
|
%restart -u @l_rusr@ |
||||||
|
rcService piknik enable yes || exit 0 |
||||||
|
rcService piknik active no && exit 0 |
||||||
|
rc piknik stop start |
||||||
|
|
||||||
|
%daily -u @l_rusr@ |
||||||
|
rcService piknik enable yes || exit 0 |
||||||
|
shtool rotate -f \ |
||||||
|
-n ${piknik_log_numfiles} -s ${piknik_log_minsize} -d \ |
||||||
|
-z ${piknik_log_complevel} -m 664 -o @l_rusr@ -g @l_rgrp@ \ |
||||||
|
-P "${piknik_log_prolog}" \ |
||||||
|
-E "${piknik_log_epilog}; rc piknik restart" \ |
||||||
|
$piknik_logfile |
||||||
|
|
||||||
Loading…
Reference in new issue