summaryrefslogtreecommitdiff
blob: a7c8159cf4b3e5ff4c9d478e2613fa3f0515ab0f (plain)
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
#!/sbin/openrc-run
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

depend() {
	need net
}

checkconfig() {
	sysrqd_secret=/etc/sysrqd/sysrqd.secret
	sysrqd_pidfile=/var/run/sysrqd.pid
	if [ ! -e ${sysrqd_secret} ]; then
		eerror "You need a '${sysrqd_secret}' containing a secret/password!"
		eerror "Refusing to start."
		return 1
	fi
}

start() {
	checkconfig || return 1
	ebegin "Starting ${SVCNAME}"
	start-stop-daemon --start --pidfile ${sysrqd_pidfile} --quiet --exec /usr/sbin/sysrqd
	eend $?
}

stop() {
	checkconfig || return 1
	ebegin "Stopping ${SVCNAME}"
	start-stop-daemon --stop --quiet --pidfile ${sysrqd_pidfile}
	eend $?
}