Revision 24213,
1.3 KB
checked in by rbasch, 15 years ago
(diff) |
In debathena-kiosk:
* Add a launcher GUI for the new gdm login window. (Trac: #431)
* Disable the tabs bar for Firefox 3.5.
* Move non-executables to /usr/share/debathena-kiosk.
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | # Start an X server for the kiosk user on an available VT. |
---|
4 | |
---|
5 | if [ "$(id -u)" -ne 0 ]; then |
---|
6 | echo "You must be root to launch kiosk mode." 1>&2 |
---|
7 | exit 1 |
---|
8 | fi |
---|
9 | |
---|
10 | datadir=/usr/share/debathena-kiosk |
---|
11 | kiosk_user=kiosk@mit |
---|
12 | kiosk_group=nogroup |
---|
13 | kiosk_home="/home/$kiosk_user" |
---|
14 | kiosk_vt_file=/var/run/athena-kiosk-vt |
---|
15 | display=99 |
---|
16 | unset XAUTHORITY |
---|
17 | |
---|
18 | # See if we already have a running kiosk session. |
---|
19 | kiosk_vt=$(cat "$kiosk_vt_file" 2>/dev/null) |
---|
20 | if [ -n "$kiosk_vt" ]; then |
---|
21 | chvt "$kiosk_vt" && exit 0 |
---|
22 | fi |
---|
23 | |
---|
24 | # Get the VT to use. |
---|
25 | kiosk_vt=$(fgconsole --next-available) |
---|
26 | if [ -z "$kiosk_vt" ]; then |
---|
27 | echo "$0: No available VTs" 1>&2 |
---|
28 | exit 1 |
---|
29 | fi |
---|
30 | |
---|
31 | # Remember that we have allocated a VT for a kiosk session. |
---|
32 | echo "$kiosk_vt" > "$kiosk_vt_file" |
---|
33 | |
---|
34 | # Set up the kiosk user home directory. |
---|
35 | rm -rf "$kiosk_home" |
---|
36 | mkdir "$kiosk_home" |
---|
37 | cp "$datadir/xinitrc" "$kiosk_home/.xinitrc" |
---|
38 | chown -R "$kiosk_user":"$kiosk_group" "$kiosk_home" |
---|
39 | |
---|
40 | # Launch the session on our VT, and wait for it to complete. This will |
---|
41 | # switch back to the current VT upon completion. |
---|
42 | openvt -c "$kiosk_vt" -s -w -- su -s /bin/sh -c "startx -- :$display -br \ |
---|
43 | -audit 0 -nolisten tcp vt$kiosk_vt" "$kiosk_user" |
---|
44 | |
---|
45 | # Ensure that the VT is deallocated. |
---|
46 | deallocvt "$kiosk_vt" > /dev/null 2>&1 |
---|
47 | rm -f "$kiosk_vt_file" |
---|
48 | |
---|
49 | rm -f "$kiosk_home/.Xauthority" |
---|
Note: See
TracBrowser
for help on using the repository browser.