View | Details | Raw Unified | Return to bug 198736 | Differences between
and this patch

Collapse All | Expand All

(-)files/smokeping.in (-10 / +28 lines)
Lines 28-33 Link Here
28
configtest_cmd="smokeping_configtest"
28
configtest_cmd="smokeping_configtest"
29
reload_cmd="smokeping_reload"
29
reload_cmd="smokeping_reload"
30
stop_cmd="smokeping_stop"
30
stop_cmd="smokeping_stop"
31
start_precmd="smokeping_startprecmd"
31
32
32
: ${smokeping_enable:=NO}
33
: ${smokeping_enable:=NO}
33
# pidfile is hardcoded in Smokeping.pm, not configurable
34
# pidfile is hardcoded in Smokeping.pm, not configurable
Lines 45-83 Link Here
45
{
46
{
46
	if [ ! -e ${smokeping_logfile} ];
47
	if [ ! -e ${smokeping_logfile} ];
47
	then
48
	then
48
		install -o %%USERS%% -g %%GROUPS%% /dev/null ${smokeping_logfile} || echo "ERROR: Could not initialize logfile at ${smokeping_logfile}.";
49
		install -o ${smokeping_user} -g ${smokeping_group} -m 644 /dev/null ${smokeping_logfile} ||\
50
			 echo "ERROR: Could not initialize logfile at ${smokeping_logfile}.";
49
	fi
51
	fi
50
}
52
}
51
53
54
smokeping_check_pidfile()
55
{
56
	rc_pid=$(check_pidfile $pidfile $command)
57
	if [ -z "${rc_pid}" ]; then
58
		rc_pid=$(check_pidfile $pidfile $command $command_interpreter)
59
	fi
60
}
61
52
smokeping_status()
62
smokeping_status()
53
{
63
{
54
	rc_pid=$(check_pidfile $pidfile $command)
64
	smokeping_check_pidfile
55
	if [ -z "$rc_pid" ]; then
65
	if [ -z "$rc_pid" ]; then
56
		_run_rc_notrunning
66
		echo "${name} is not running."
67
		return 1
57
	else
68
	else
58
		echo "${name} is running as pid $rc_pid"
69
		echo "${name} is running as pid $rc_pid"
59
        fi
70
	fi
60
}
71
}
61
72
62
smokeping_configtest()
73
smokeping_configtest()
63
{
74
{
64
	/usr/local/bin/smokeping --check
75
	${command} --check
65
}
76
}
66
77
67
smokeping_reload()
78
smokeping_reload()
68
{
79
{
69
	/usr/local/bin/smokeping --reload
80
	smokeping_check_pidfile
81
	if [ -z "$rc_pid" ]; then
82
		_run_rc_notrunning
83
		return 1
84
	else
85
		${command} --reload
86
	fi
70
}
87
}
71
88
72
smokeping_stop()
89
smokeping_stop()
73
{
90
{
74
	rc_pid=$(check_pidfile $pidfile $command)
91
	smokeping_check_pidfile
75
	if [ -z "$rc_pid" ]; then
92
	if [ -z "$rc_pid" ]; then
76
		_run_rc_notrunning
93
		_run_rc_notrunning
94
		return 1
77
	else
95
	else
78
		echo "Stopping ${name} (pid $rc_pid)."
96
		echo "Stopping ${name}."
79
		kill -15 $rc_pid
97
		kill -TERM $rc_pid
80
        fi
98
	fi
81
}
99
}
82
100
83
load_rc_config $name
101
load_rc_config $name

Return to bug 198736