2 # Filename: grml-setservices
3 # Purpose: interface for basic configuration of system startup
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 # Latest change: Mit Jul 04 10:53:22 CEST 2007 [mika]
8 ################################################################################
13 CONFFILE='/etc/runlevel.conf'
15 . /etc/grml/script-functions
16 . /etc/grml/lsb-functions
18 check4root || exit 100
28 [ -n "$1" ] || return 2
29 [ -r "$TMP" ] || return 3
30 grep -q "$1" $TMP && return 0 || return 1
33 INFO="Which services would you like to have enabled on your system?
35 Notice: this script will adjust your ${CONFFILE}, the
36 file which provides the startup configuration for your
37 system. You can edit the file manually as well.
39 If you do not know what to choose just take the defaults
43 # enable checks only if the according init script is present
44 [ -r /etc/init.d/lvm2 ] && LVM='lvm!logical volume management!on'
45 [ -r /etc/init.d/mdadm ] && SRAID='mdadm!software-raid via mdadm!on'
46 [ -r /etc/init.d/dmraid ] && MRAID='dmraid!software-raid via dmraid!off'
47 [ -r /etc/init.d/dbus -o -r /etc/init.d/dbus-1 ] && DBUS='dbus!hal/dbus (important for KDE e.g.)!off'
52 # remove_from_runlevel.conf
53 # set_up_defaults_as_intented_in_/var/lib/dpkg/info/$PACKAGE.postinst
55 # remove_from_runlevel.conf
56 # set_up_only_for_stop_to_prevent_reactivation_via_maintainer_scripts_on_upgrade
58 if [ -n "$LVM" ] ; then
59 if is_value_set "lvm" ; then
60 update-rc.d -f lvm2 remove >/dev/null 2>&1
61 update-rc.d lvm2 start 26 S . start 50 0 6 .
63 update-rc.d -f lvm2 remove >/dev/null 2>&1
64 update-rc.d lvm2 stop 20 0 1 6 . >/dev/null 2>&1
68 if [ -n "$SRAID" ] ; then
69 if is_value_set "mdadm" ; then
70 update-rc.d -f mdadm remove >/dev/null 2>&1
71 update-rc.d mdadm-raid start 25 S . start 50 0 6 . >/dev/null 2>&1
72 update-rc.d mdadm defaults 25 >/dev/null 2>&1
74 update-rc.d -f mdadm remove >/dev/null 2>&1
75 update-rc.d mdadm stop 20 0 1 6 . >/dev/null 2>&1
76 update-rc.d -f mdadm-raid remove >/dev/null 2>&1
77 update-rc.d mdadm-raid stop 20 0 1 6 . >/dev/null 2>&1
81 if [ -n "$MRAID" ] ; then
82 if is_value_set "dmraid" ; then
83 update-rc.d -f dmraid remove >/dev/null 2>&1
84 update-rc.d dmraid start 04 S . start 51 0 6 . >/dev/null
86 update-rc.d -f dmraid remove >/dev/null 2>&1
87 update-rc.d dmraid stop 20 0 1 6 . >/dev/null 2>&1
91 if [ -n "$DBUS" ] ; then
92 if is_value_set "dbus" ; then
93 update-rc.d -f dbus remove >/dev/null 2>&1
94 update-rc.d dbus defaults >/dev/null 2>&1
96 update-rc.d -f dbus remove >/dev/null 2>&1
97 update-rc.d dbus stop 20 0 1 6 . >/dev/null 2>&1
102 # the interface itself
105 $DIALOG --title "$PN" --checklist "$INFO" 30 65 8 $LVM $SRAID $MRAID $DBUS 2>$TMP
110 (1) echo "Cancel pressed." ; exit 1 ;;
111 (255) echo "ESC pressed." ; exit 1 ;;
117 $DIALOG --title "$PN" --stdout --msgbox "Adjusting system runlevel configuration via $CONFFILE was successful." 0 0
118 esyslog user.notice "$PN" "Writing language settings ($LANGUAGE) to $CONFFILE was successful."
121 $DIALOG --title "$PN" --stdout --msgbox "Error writing settings to ${CONFFILE}." 0 0
122 esyslog user.notice "$PN" "Error writing settings to ${CONFFILE}."
129 ## END OF FILE #################################################################
130 # vim: ai tw=80 expandtab