~xubuntu-dev/ubiquity/lp1437180_feh

« back to all changes in this revision

Viewing changes to debian/init

  • Committer: Colin Watson
  • Date: 2007-09-06 11:18:51 UTC
  • Revision ID: cjwatson@canonical.com-20070906111851-h1cjoxhwwvlybztk
* If 'automatic-ubiquity' is on the kernel command line, start Ubiquity in
  its own X session.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
set -e
 
4
 
 
5
PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
6
NAME=ubiquity
 
7
 
 
8
test -x /usr/bin/ubiquity-dm || exit 0
 
9
 
 
10
for x in $(cat /proc/cmdline); do
 
11
        case $x in
 
12
                automatic-ubiquity)
 
13
                        ;;
 
14
                *)
 
15
                        [ "$1" = force-start ] || exit 0
 
16
                        ;;
 
17
        esac
 
18
done
 
19
    
 
20
if [ -r /etc/environment ]; then
 
21
        if LANG=$(pam_getenv -l LANG); then
 
22
                export LANG
 
23
        fi
 
24
        if LANGUAGE=$(pam_getenv -l LANGUAGE); then
 
25
                export LANGUAGE
 
26
        fi
 
27
fi
 
28
 
 
29
. /lib/lsb/init-functions
 
30
 
 
31
case "$1" in
 
32
        start|force-start)
 
33
                log_begin_msg "Starting Ubiquity..."
 
34
                # if usplash is running, make sure to stop it now, yes "start" kills it.
 
35
                if pidof usplash > /dev/null; then
 
36
                        usplash=:
 
37
                        orig_console="$(fgconsole)"
 
38
                        DO_NOT_SWITCH_VT=yes /etc/init.d/usplash start
 
39
                        # We've just shut down usplash, so don't log
 
40
                        # success as it will look weird on the console.
 
41
                        log_end_msg=:
 
42
                else
 
43
                        usplash=false
 
44
                        log_end_msg=log_end_msg
 
45
                fi
 
46
                # Run in the foreground.
 
47
                if ubiquity-dm vt7 :0 /usr/bin/ubiquity; then
 
48
                        $log_end_msg 0
 
49
                else
 
50
                        log_end_msg $?
 
51
                fi
 
52
 
 
53
                if $usplash && [ "$orig_console" != serial ]; then
 
54
                        # Wait a short while for the active console to
 
55
                        # change, to try to avoid visible console noise from
 
56
                        # later init scripts.
 
57
                        i=0
 
58
                        while [ "$(fgconsole)" = "$orig_console" ]; do
 
59
                                i="$(($i + 1))"
 
60
                                if [ "$i" -gt 5 ]; then
 
61
                                        break
 
62
                                fi
 
63
                                sleep 1
 
64
                        done
 
65
                fi
 
66
        ;;
 
67
        stop|restart|force-reload)
 
68
        ;;
 
69
        *)
 
70
                N=/etc/init.d/$NAME
 
71
                echo "Usage: $N {start|force-start|stop|restart|force-reload}" >&2
 
72
                exit 1
 
73
        ;;
 
74
esac
 
75
 
 
76
exit 0