source: lmd-client/trunk/fuentes/install/usr/share/ltsp/init-ltsp.d.diversions/50-rm-system-services.lliurex @ 6129

Last change on this file since 6129 was 6129, checked in by hectorgh, 3 years ago

restoring rpcbind services to make promethean whiteboards work

File size: 4.7 KB
Line 
1# Remove some system services that don't make sense in live sessions.
2# The user can add more items by declaring space separated RM_SYSTEM_SERVICES
3# or RM_THIN_SYSTEM_SERVICES lists in lts.conf.
4# The RM_THIN_SYSTEM_SERVICES list is ignored by fat clients.
5# KEEP_SYSTEM_SERVICES is a space separated whitelist of services.
6
7allowed_services() {
8    local service
9
10    echo "$@" | sed 's/#.*//' | while read service; do
11        case " $KEEP_SYSTEM_SERVICES " in
12            *" $service "*)
13                ;;
14            *)
15                echo -n " $service"
16                ;;
17        esac
18    done
19}
20
21# $RM_SYSTEM_SERVICES are removed for all clients
22rm_services="$(allowed_services "$RM_SYSTEM_SERVICES
23alsa-restore          # Restore sound card(s') mixer state(s)
24alsa-store            # Save sound card(s') mixer state(s)
25dnsmasq               # A lightweight DHCP and caching DNS server
26exim4                 # exim4 Mail Transport Agent
27grub-common           # Record successful boot for GRUB
28lightdm               # Light Display Manager
29lvm2-lvmetad          # LVM2 metadata daemon
30mdadm                 # MD monitoring daemon
31ModemManager          # Modem manager
32modemmanager          # Modem manager (older versions)
33nbd-client            # Network Block Device client (we use nbd-disconnect)
34nbd-server            # Network Block Device server
35plymouth-stop         # Hide the splash screen
36rfkill-store          # Store software rfkill state
37shared-folders        # Shared folders service
38ssh                   # OpenSSH server
39tty2                  # Getty
40tty3                  # Getty
41tty4                  # Getty
42tty5                  # Getty
43tty6                  # Getty
44unattended-upgrades   # Check if unattended upgrades are being applied
45urandom               # Save and restore random seed between restarts
46x2goserver            # X2Go daemon responsible for post-session clean-ups
47")"
48
49# $RM_THIN_SYSTEM_SERVICES are removed for thin clients
50if ! boolean_is_true "$LTSP_FATCLIENT"; then
51    rm_services="$rm_services $(allowed_services "$RM_THIN_SYSTEM_SERVICES
52accounts-daemon       # Accounts Service
53acpid                 # ACPI daemon
54apparmor              # AppArmor initialization
55apport                # Automatic crash report generation
56atd                   # Deferred execution scheduler
57avahi-daemon          # mDNS/DNS-SD daemon
58bluetooth             # Bluetooth daemon
59brltty                # Braille terminal driver
60cgmanager             # Cgroup management daemon
61cups                  # CUPS Printing spooler and server
62cups-browsed          # CUPS browse daemon
63kerneloops            # Collects and submits kernel crash signatures
64network-manager       # Network connection manager
65NetworkManager        # Network Manager
66NetworkManager-wait-online        # Network Manager Wait Online
67NetworkManager-script-dispatcher  # Network Manager Script Dispatcher Service
68polkitd               # Authenticate and Authorize Users to Run Privileged Tasks
69systemd-logind        # Login Service
70teamviewerd           # TeamViewer remote control daemon
71ufw                   # Uncomplicated Firewall
72upstart-socket-bridge # Bridge socket events into upstart
73virtualbox            # VirtualBox Linux kernel module
74vboxweb               # VirtualBox Web Service
75whoopsie              # crash report submission daemon
76wpa_supplicant        # WPA supplicant
77")"
78
79    # For low RAM thin clients, disable whatever isn't essential for booting
80    memtotal=$(awk '/^MemTotal:/ { print int($2/1024) }' /proc/meminfo)
81    RM_RAM_THRESHOLD=${RM_RAM_THRESHOLD:-200}
82    if [ "$memtotal" -le "$RM_RAM_THRESHOLD" ]; then
83        rm_services="$rm_services $(allowed_services "$RM_LOW_RAM_SERVICES
84anacron               # anac(h)ronistic cron
85#dbus                  # D-Bus system message bus - systemd depends on it
86cron                  # Regular background program processing daemon
87getty@                # Getty on %I
88rsyslog               # System logging daemon
89tty1                  # Getty
90upstart-udev-bridge   # Bridge udev events into upstart
91")"
92    fi
93fi
94
95# We don't need NFS-related services if we're not using nfs
96if ! grep -q nfs /etc/fstab; then
97    rm_services="$rm_services $(allowed_services "
98gssd                  # rpcsec_gss daemon
99idmapd                # NFSv4 id <-> name mapper
100nfs-blkmap            # pNFS block layout mapping daemon
101nfs-kernel-server     # Kernel NFS server support
102nfs-mountd            # NFS Mount Daemon
103nfs-server            # NFS server and services
104nfs-utils             # NFS server and client services
105statd                 # NSM status monitor
106")"
107fi
108
109for service in $rm_services; do
110    rm -f /etc/rc?.d/???"$service" "/etc/init.d/$service" "/etc/init/$service.conf" "/lib/systemd/system/$service."* "/etc/systemd/system/$service."*
111done
Note: See TracBrowser for help on using the repository browser.