mkimage-profiles/features.in/live/live/image-scripts.d/03-services

63 lines
856 B
Plaintext
Raw Normal View History

#!/bin/sh
# see also m-p-d::profiles/live/image-scripts.d/init3-services
[ -x /sbin/chkconfig -o -x /bin/systemctl ] || exit 0
switch() {
case "$2" in
on)
cc=on; sc=enable;;
off)
cc=off; sc=disable;;
esac
{
[ ! -x /bin/systemctl ] || /bin/systemctl $sc $1.service
[ ! -x /sbin/chkconfig ] || /sbin/chkconfig $1 $cc
} 2>/dev/null
}
ENABLE="
dm
gdm
kdm
wdm
prefdm
alteratord
livecd-evms
livecd-fstab
livecd-hostname
livecd-save-nfs
livecd-setauth
livecd-setlocale
network
NetworkManager
connman
random
rpcbind
"
# NB: dnsmasq: https://bugzilla.altlinux.org/show_bug.cgi?id=18799
# NB: sshd might be needed for some particular cases
DISABLE="
anacron
bridge
clamd
crond
dhcpd
dnsmasq
mdadm
netfs
openvpn
rawdevices
slapd
smartd
sshd
update_wms
xinetd
"
for i in $ENABLE; do switch $i on; done
for i in $DISABLE; do switch $i off; done
: