live: support systemctl to enable *dm
systemd is a tricky beast: getting it to actually launch gdm required considerable effort on the part of stupid myself. The relevant links: * https://wiki.archlinux.org/index.php/Systemd#Running_DEs_under_systemd * http://unix.stackexchange.com/a/35626/15296 Still looks pretty dirty, and there's some duplication with a hook in features.in/slinux as well.
This commit is contained in:
parent
6a6a0e1c01
commit
0efba3e42c
@ -1,10 +1,28 @@
|
||||
#!/bin/sh
|
||||
# see also m-p-d::profiles/live/image-scripts.d/init3-services
|
||||
|
||||
[ -x /sbin/chkconfig ] || exit 0
|
||||
[ -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
|
||||
@ -38,6 +56,6 @@ update_wms
|
||||
xinetd
|
||||
"
|
||||
|
||||
for i in $ENABLE; do chkconfig $i on 2>/dev/null; done
|
||||
for i in $DISABLE; do chkconfig $i off 2>/dev/null; done
|
||||
for i in $ENABLE; do switch $i on; done
|
||||
for i in $DISABLE; do switch $i off; done
|
||||
:
|
||||
|
Loading…
x
Reference in New Issue
Block a user