summaryrefslogtreecommitdiff
path: root/gui-libs/display-manager-init/files/startDM-r1
blob: 11309bb45f296e7aab6409990c7381b5ebb2217c (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
37
38
#!/bin/sh
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License, v2

# We need to source /etc/profile.env for stuff like $LANG to work
# bug #10190.
. /etc/profile.env

# need eerror
. /lib/gentoo/functions.sh

# Bail out early if on a non-OpenRC system:
if [ ! -d /run/openrc ]; then
	eerror "$0 should only be used on OpenRC systems"
	exit 1
fi

# rc_libexec moved in >=openrc-0.56
if [ -e /lib/rc/sh/functions.sh ]; then
	. /lib/rc/sh/functions.sh
elif [ -e /usr/libexec/rc/sh/functions.sh ]; then
	. /usr/libexec/rc/sh/functions.sh
else
	eerror "Unable to find rc/sh/functions.sh"
	exit 1
fi

export RC_SVCNAME=display-manager
EXEC="$(get_options service)"
NAME="$(get_options name)"
PIDFILE="$(get_options pidfile)"
START_STOP_ARGS="$(get_options start_stop_args)"

start-stop-daemon --start --exec "${EXEC}" \
${NAME:+--name} ${NAME} ${PIDFILE:+--pidfile} ${PIDFILE} ${START_STOP_ARGS} || \
eerror "ERROR: could not start the Display Manager"

# vim:ts=4