Advertisement
Forage

Untitled

Apr 12th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. # gdm - GNOME Display Manager
  2. #
  3. # The display manager service manages the X servers running on the
  4. # system, providing login and auto-login services
  5.  
  6. description "GNOME Display Manager"
  7. author "William Jon McCann <mccann@jhu.edu>"
  8.  
  9. start on ((filesystem
  10. and runlevel [!06]
  11. and started dbus
  12. and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
  13. or stopped udev-fallback-graphics))
  14. or runlevel PREVLEVEL=S)
  15.  
  16. stop on runlevel [016]
  17.  
  18. emits login-session-start
  19. emits desktop-session-start
  20. emits desktop-shutdown
  21.  
  22. env XORGCONFIG=/etc/X11/xorg.conf
  23.  
  24. script
  25. if [ -n "$UPSTART_EVENTS" ]
  26. then
  27. # Check kernel command-line for inhibitors, unless we are being called
  28. # manually
  29. for ARG in $(cat /proc/cmdline); do
  30. if [ "$ARG" = "text" ]; then
  31. plymouth quit || :
  32. stop
  33. exit 0
  34. fi
  35. done
  36.  
  37. if [ -f /etc/X11/default-display-manager ]; then
  38. [ "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/sbin/gdm" ] || { stop; exit 0; }
  39. else
  40. type lightdm >/dev/null 2>&1 && { stop; exit 0; } || true
  41. fi
  42.  
  43. if [ "$RUNLEVEL" = S -o "$RUNLEVEL" = 1 ]
  44. then
  45. # Single-user mode
  46. plymouth quit || :
  47. exit 0
  48. fi
  49. fi
  50.  
  51. test -f /etc/profile && . /etc/profile
  52.  
  53. if [ -r /etc/default/locale ]; then
  54. . /etc/default/locale
  55. export LANG LANGUAGE LC_MESSAGES LC_ALL
  56. elif [ -r /etc/environment ]; then
  57. . /etc/environment
  58. export LANG LANGUAGE LC_MESSAGES LC_ALL
  59. fi
  60. export XORGCONFIG
  61.  
  62. # update the dconf profile if needed
  63. needed=no
  64. if [ ! -f /etc/dconf/db/gdm ]; then
  65. needed=yes
  66. else
  67. for f in \
  68. /etc/dconf/db/gdm.d /etc/dconf/db/gdm.d/*-settings \
  69. /etc/dconf/db/gdm.d/locks /etc/dconf/db/gdm.d/locks/*-locks \
  70. /etc/gdm/greeter.gsettings; do
  71. if [ "$f" -nt /etc/dconf/db/gdm ]; then # newer?
  72. needed=yes
  73. break
  74. fi
  75. done
  76. fi
  77. if [ "$needed" = yes ]; then
  78. # The configuration file in /etc uses org.gnome.blah gsettings syntax.
  79. # Convert it to org/gnome/blah dconf syntax, if needed (newer)
  80. dist_settings=/etc/dconf/db/gdm.d/90-debian-settings
  81. if [ ! -f $dist_settings ] || \
  82. [ /etc/gdm/greeter.gsettings -nt $dist_settings ] ; then
  83. awk '/\[.*\]/ { gsub("\\.","/"); } ! /^#/ { print;}' \
  84. /etc/gdm/greeter.gsettings > $dist_settings
  85. fi
  86. echo "Updating dconf for gdm..."
  87. dconf update
  88. fi
  89.  
  90. exec gdm $CONFIG_FILE
  91. end script
  92.  
  93. post-stop script
  94. if [ "$UPSTART_STOP_EVENTS" = runlevel ]; then
  95. initctl emit desktop-shutdown
  96. fi
  97. end script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement