#!/sbin/openrc-run
### BEGIN INIT INFO
# Provides:    elogind
# Required-Start:
# Required-Stop:
# Default-Start: 5
# Default-Stop:
# Short-Description: Pseudo LSB Header, to satisfy the OBS expectations
### END INIT INFO
# Copyright 1999-2017 Gentoo Foundation
# 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 "/run/elogind.pid" \
		--exec "/lib/elogind/elogind" -- --daemon
	eend $?
}

stop() {
	ebegin "Stopping elogind"
	start-stop-daemon --stop --quiet --pidfile "/run/elogind.pid"
	eend $?
}
