summaryrefslogtreecommitdiff
blob: 5ea0be510232f67a9936560978c642e3c184c6da (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
33
34
35
36
#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

depend() {
	need dbus

	# Make sure elogind is up before xdm starts any dm
	before xdm
}

start() {
	ebegin "Starting elogind"

	start-stop-daemon --start --quiet \
		--pidfile "${ELOGIND_PIDFILE}" \
		--exec "${ELOGIND_EXEC}" -- --daemon
	eend $?
}

stop() {
	local stop_timeout="SIGTERM/10/SIGKILL/3"

	if [ ${RC_CMD} = "restart" ] ; then
		ebegin "Interrupting elogind"
		stop_timeout="SIGINT/10/SIGINT/5/${stop_timeout}"
	else
		ebegin "Stopping elogind"
	fi

	start-stop-daemon --stop --quiet \
		--retry ${stop_timeout} \
		--pidfile "${ELOGIND_PIDFILE}"

	eend $?
}