source: src-sh/pc-extractoverlay/ports-overlay/usr/local/etc/rc.d/gdm @ 2001c86

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since 2001c86 was 2001c86, checked in by Kris Moore <kris@…>, 14 months ago

Add the GDM pam.d / rc.d scripts again

  • Property mode set to 100755
File size: 2.6 KB
Line 
1#!/bin/sh
2# $FreeBSD: ports/x11/gdm/files/gdm.in,v 1.20 2010/07/25 19:35:05 kwm Exp $
3#    $MCom: ports-stable/x11/gdm/files/gdm.in,v 1.5 2010/07/21 13:50:46 kwm Exp $
4
5# PROVIDE: gdm
6# REQUIRE: LOGIN cleanvar moused syscons dbus
7#
8# Add the following to /etc/rc.conf to start GDM at boot time:
9#
10# gdm_enable="YES"
11#
12
13. /etc/rc.subr
14. /usr/local/etc/gnome.subr
15
16gdm_enable=${gdm_enable-${gnome_enable}}
17gdm_preserve_base_pam_conf=${gdm_preserve_base_pam_conf-NO}
18gdm_lang=${gdm_lang-${LANG}}
19
20export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
21
22setup_xorg() {
23        /usr/local/share/pcbsd/xorg-gui/bin/rundetect.sh
24        rm -f /var/.runxsetup
25        unset PROGDIR
26}
27
28setup_firstboot() {
29        unset PROGDIR
30        /usr/local/bin/pc-firstgui
31        rm /var/.pcbsd-firstgui
32}
33
34setup_xvesa() {
35        echo "Using failsafe VESA 1024x768 mode..." >/dev/console
36        mv /etc/X11/xorg.conf /etc/X11/xorg.conf.preVesa.backup
37        cp /usr/local/share/pcbsd/xorg-gui/cardDetect/XF86Config.compat /etc/X11/xorg.conf
38}
39
40# Check if we are going to re-run the display setup wizard
41y=`kenv runwiz 2>/dev/null`
42if [ $? -eq 0 ]; then
43   if [ "$y" = "YES" ] ; then
44     touch /var/.runxsetup
45   fi
46   kenv -u runwiz
47fi
48
49xvesa="NO"
50v=`kenv xvesa 2>/dev/null`
51if [ $? -eq 0 ]; then
52   xvesa=$v
53fi
54
55name="gdm"
56rcvar=gdm_enable
57command="/usr/local/sbin/${name}"
58pidfile="/var/run/${name}.pid"
59procname="/usr/local/sbin/gdm-binary"
60start_cmd="gdm_start"
61
62gdm_start()
63{
64    if ! checkyesno gdm_enable ; then
65        return 0
66    fi
67    echo "Starting ${name}."
68   
69    # Update the pixbuf cache, otherwise weirdness insues
70    gdk-pixbuf-query-loaders --update-cache
71
72    # make sure there is no pam configuration for gdm service in base system
73    if ! checkyesno gdm_preserve_base_pam_conf && [ -f /etc/pam.d/gdm ]; then
74        cp -p /etc/pam.d/gdm /etc/pam.d/gdm_disabled
75        rm -f /etc/pam.d/gdm
76    fi
77
78    ( iter=0
79    while ! ps -axoargs | grep "^/usr/libexec/getty " | grep -qv grep >/dev/null 2>&1; do
80        if [ ${iter} -eq 60 ]; then
81            break
82        fi
83        sleep 1
84        iter=$(expr ${iter} + 1)
85    done
86    iter=0
87    while ! /usr/local/bin/lshal >/dev/null 2>&1 ; do
88        if [ ${iter} -eq 60 ]; then
89            break
90        fi
91        sleep 1
92        iter=$(expr ${iter} + 1)
93    done
94
95    # If the user wants to switch to failsafe X
96    if [ ${xvesa} = "YES" ]; then
97        setup_xvesa
98    fi
99
100    # If the user wants to switch to run the xorg setup again
101    if [ -e "/var/.runxsetup" -a "$xvesa" != "YES" ]; then
102        setup_xorg
103    fi
104
105    # Check if we need to do a first boot setup
106    if [ -e "/var/.pcbsd-firstgui" ]; then
107       setup_firstboot
108    fi
109
110    # Start GDM now
111    LANG=${gdm_lang} ${command} ${gdm_flags} ) &
112}
113
114load_rc_config ${name}
115run_rc_command "$1"
Note: See TracBrowser for help on using the repository browser.