From 4bd6eca3644642ff20d48d38c250d7ab1a62ec78 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sun, 27 Oct 2019 01:22:30 -0400 Subject: Add reload cmd to rc script Using daemon(8) makes this way more awkward than it should be. --- rc.pounce | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/rc.pounce b/rc.pounce index bf95504..599c585 100644 --- a/rc.pounce +++ b/rc.pounce @@ -8,20 +8,25 @@ name='pounce' rcvar='pounce_enable' +extra_commands='reload' +sig_reload='USR1' load_rc_config "${name}" : ${pounce_enable:="NO"} -_command='/usr/local/bin/pounce' command='/usr/sbin/daemon' pidprefix="/var/run/${name}" pidfile="${pidprefix}.pid" +child_command='/usr/local/bin/pounce' +child_pidfile="${pidprefix}.child.pid" + if [ -n "$2" ]; then profile=$2 if [ -n "${pounce_profiles}" ]; then pidfile="${pidprefix}.${profile}.pid" + child_pidfile="${pidprefix}.${profile}.child.pid" eval pounce_enable="\${pounce_${profile}_enable:-${pounce_enable}}" eval pounce_flags="\${pounce_${profile}_flags:-${pounce_flags}}" eval pounce_user="\${pounce_${profile}_user:-${pounce_user}}" @@ -38,12 +43,18 @@ else fi fi -_pounce_flags=$pounce_flags -_pounce_user=$pounce_user +child_flags=$pounce_flags +child_user=$pounce_user unset pounce_flags pounce_user command_args="\ - -r -P ${pidfile} -T ${name}${profile:+/${profile}} \ - ${_pounce_user:+-u ${_pounce_user}} \ - -- ${_command} ${_pounce_flags}" + -r -P ${pidfile} -p ${child_pidfile} -T ${name}${profile:+/${profile}} \ + ${child_user:+-u ${child_user}} \ + -- ${child_command} ${child_flags}" + +pounce_reload() { + rc_pid=$(check_pidfile "$child_pidfile" "$child_command") + kill "-$sig_reload" "$rc_pid" +} +reload_cmd='pounce_reload' run_rc_command "$1" -- cgit 1.4.1 'grep'>log msg
path: root/ui-commit.c (unfollow)
Commit message (Expand)Author
2014-01-12ui-snapshot: set unused cgit_filter fields to zeroJohn Keeping
2014-01-12html: remove redundant htmlfd variableJohn Keeping
2014-01-12tests: add Valgrind supportJohn Keeping
2014-01-12cache: don't leave cache_slot fields uninitializedJohn Keeping
2014-01-10filter: split filter functions into their own fileJason A. Donenfeld
2014-01-10filter: make exit status localJason A. Donenfeld
2014-01-10parsing: fix header typoJason A. Donenfeld
2014-01-10cgit.c: Fix comment on bit mask hackLukas Fleischer
2014-01-10cgit.c: Use "else" for mutually exclusive branchesLukas Fleischer
2014-01-10ui-snapshot.c: Do not reinvent suffixcmp()Lukas Fleischer
2014-01-10Refactor cgit_parse_snapshots_mask()Lukas Fleischer
2014-01-10Disallow use of undocumented snapshot delimitersLukas Fleischer
2014-01-10Replace most uses of strncmp() with prefixcmp()Lukas Fleischer
2014-01-09README: Fix dependenciesLukas Fleischer
2014-01-08README: Spelling and formatting fixesLukas Fleischer
2014-01-08Fix UTF-8 with syntax-highlighting.pyPřemysl Janouch
2014-01-08Add a suggestion to the manpagePřemysl Janouch
2014-01-08Fix the example configurationPřemysl Janouch
2014-01-08Fix about-formatting.shPřemysl Janouch
2014-01-08Fix some spelling errorsPřemysl Janouch
2014-01-08filters: highlight.sh: add css comments for highlight 2.6 and 3.8Ferry Huberts