summary refs log tree commit diff
path: root/rc.d/pounce
blob: 9777fdae87800ff595550baac77a9b8365c986ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh

# PROVIDE: pounce
# REQUIRE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name='pounce'
rcvar='pounce_enable'
extra_commands='reload'
sig_reload='USR1'

load_rc_config "${name}"

: ${pounce_enable:='NO'}
: ${pounce_chdir:="/usr/local/etc/${name}"}

command='/usr/sbin/daemon'
pidprefix="/var/run/${name}"
pidfile="${pidprefix}.pid"
required_dirs=$pounce_chdir

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_chdir="\${pounce_${profile}_chdir:-${pounce_chdir}}"
		eval pounce_user="\${pounce_${profile}_user:-${pounce_user}}"
	else
		echo "$0: extra argument ignored"
	fi
else
	if [ -n "${pounce_profiles}" -a -n "$1" ]; then
		for profile in ${pounce_profiles}; do
			echo "===> ${name} profile: ${profile}"
			/usr/local/etc/rc.d/${name} "$1" "${profile}" || exit "$?"
		done
		exit
	fi
fi

child_flags=$pounce_flags
child_user=$pounce_user
unset pounce_flags pounce_user
command_args="\
	-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"
09964d0c00607e983c1fc9db978&follow=1'>Remove clientRemove call from clientCastJune McEnroe If an error occurs on a client socket during a broadcast, that client will show up in the kqueue loop with EV_EOF and get removed that way. Tested by sending SIGKILL to a client and watching its cursor disappear. 2017-09-01Add client readOnly modeJune McEnroe 2017-08-31Clean up merge toolJune McEnroe Choose the version with the most recent access if the modify times are the same. 2017-08-31Choose B for tiles with equal modify timesJune McEnroe This way newer access counts and times will be preserved. 2017-08-31Add quick data file merge toolJune McEnroe Hopefully I won't have to use it ever again. 2017-08-30Use only foreground color for selecting spawnJune McEnroe 2017-08-29Add four additional spawnsJune McEnroe 2017-08-28Add respawningJune McEnroe 2017-08-26Move license above includesJune McEnroe Why was it down there? 2017-08-26Snapshot metadataJune McEnroe 2017-08-26Add meta.c to READMEJune McEnroe 2017-08-26Use MakefileJune McEnroe