1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-31 10:46:16 +00:00
freebsd-ports/x11/gdm/files/gdm.in
Koop Mast d129587b5d The FreeBSD GNOME team proudly presents GNOME 3.16 for FreeBSD.
The offical GNOME 3.16 release notes can be found at https://help.gnome.org/misc/release-notes/3.16/

Upgrade instructions for port users:

Delete the old tracker package with:
# pkg delete -f tracker
And user port upgrade tool of choice to upgrade.

Thanks to Antoine Brodin for running the exp-runs.

This release was made possible by the following people:
  Gustau Perez
  Ting-Wei_Lan

PR:		201980
2015-08-05 19:13:24 +00:00

77 lines
1.8 KiB
Bash

#!/bin/sh
# $FreeBSD$
# $MCom: ports/trunk/x11/gdm3/files/gdm.in 18610 2013-06-30 16:33:05Z marcus $
# PROVIDE: gdm
# REQUIRE: LOGIN cleanvar moused syscons dbus
#
# Add the following to /etc/rc.conf to start GDM at boot time:
#
# gdm_enable="YES"
#
. /etc/rc.subr
. %%GNOME_SUBR%%
gdm_enable=${gdm_enable-${gnome_enable}}
gdm_preserve_base_pam_conf=${gdm_preserve_base_pam_conf-NO}
gdm_lang=${gdm_lang-${LANG}}
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:%%LOCALBASE%%/bin:%%LOCALBASE%%/sbin
name="gdm"
rcvar=gdm_enable
command="%%PREFIX%%/sbin/${name}"
pidfile="/var/run/${name}.pid"
procname="%%PREFIX%%/sbin/gdm-binary"
start_cmd="gdm_start"
stop_cmd="gdm_stop"
gdm_start()
{
if ! checkyesno gdm_enable ; then
return 0
fi
echo "Starting ${name}."
# we need to remove locking files under $gdm_home/.cache/gnome-shell/
# until XDG_RUNTIME_DIR can be set and used
rm -fr %%PREFIX%%/etc/gdm/home/.cache/gnome-shell/runtime-state*
# make sure there is no pam configuration for gdm service in base system
if ! checkyesno gdm_preserve_base_pam_conf && [ -f /etc/pam.d/gdm ]; then
cp -p /etc/pam.d/gdm /etc/pam.d/gdm_disabled
rm -f /etc/pam.d/gdm
fi
( iter=0
while ! ps -axoargs | grep "^/usr/libexec/getty " | grep -qv grep >/dev/null 2>&1; do
if [ ${iter} -eq 60 ]; then
break
fi
sleep 1
iter=$(expr ${iter} + 1)
done
iter=0
while ! %%LOCALBASE%%/bin/lshal >/dev/null 2>&1 ; do
if [ ${iter} -eq 60 ]; then
break
fi
sleep 1
iter=$(expr ${iter} + 1)
done
LANG=${gdm_lang} ${command} ${gdm_flags} ) &
}
gdm_stop()
{
echo "Stopping ${name}."
/bin/kill -9 $(/bin/cat "${pidfile}")
pkill -9 -u gdm
pkill -9 X
pkill -9 gdm-session-worker
}
load_rc_config ${name}
run_rc_command "$1"