diff options
Diffstat (limited to 'extra/lxdm/lxdm.install')
-rw-r--r-- | extra/lxdm/lxdm.install | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/extra/lxdm/lxdm.install b/extra/lxdm/lxdm.install new file mode 100644 index 000000000..8d42de90f --- /dev/null +++ b/extra/lxdm/lxdm.install @@ -0,0 +1,59 @@ +pkgname=lxdm + +post_install() { + # make sure the group and user "lxdm" exist on this system and have the correct values + if grep -q "^lxdm:" /etc/group &> /dev/null ; then + groupmod -g 121 -n lxdm lxdm &> /dev/null + else + groupadd -g 121 lxdm &> /dev/null + fi + + if grep -q "^lxdm:" /etc/passwd 2> /dev/null ; then + usermod -s /sbin/nologin -c "LXDE Display Manager user" -d /var/lib/lxdm -u 121 -g lxdm lxdm &> /dev/null + else + useradd -s /sbin/nologin -c "LXDE Display Manager user" -d /var/lib/lxdm -u 121 -g lxdm -m -r lxdm &> /dev/null + fi + passwd -l lxdm > /dev/null + +# chown root:lxdm /etc/lxdm/{lxdm.conf,xinitrc} > /dev/null + chown root:lxdm /etc/lxdm/lxdm.conf > /dev/null + chown -R root:lxdm /var/lib/lxdm > /dev/null + chown -R root:lxdm /var/run/lxdm > /dev/null + +cat << EOF +>>> To make the LXDM as your default DM, +>>> put, 'lxdm' or '@lxdm' (without quotes) on DAEMONS in /etc/rc.conf +>>> +>>> You can also use /etc/inittab, +>>> just add 'x:5:respawn:/usr/sbin/lxdm >& /dev/null' (without quotes) +>>> in the end of the file /etc/inittab +>>> and uncoment the line on the top 'id:5:initdefault:'. +EOF +} + +post_upgrade() { + # make sure the group and user "lxdm" exist on this system and have the correct values + if grep -q "^lxdm:" /etc/group &> /dev/null ; then + groupmod -g 121 -n lxdm lxdm &> /dev/null + else + groupadd -g 121 lxdm &> /dev/null + fi + + if grep -q "^lxdm:" /etc/passwd 2> /dev/null ; then + usermod -s /sbin/nologin -c "LXDE Display Manager user" -d /var/lib/lxdm -u 121 -g lxdm lxdm &> /dev/null + else + useradd -s /sbin/nologin -c "LXDE Display Manager user" -d /var/lib/lxdm -u 121 -g lxdm -m -r lxdm &> /dev/null + fi + passwd -l lxdm > /dev/null + +# chown root:lxdm /etc/lxdm/{lxdm.conf,xinitrc} > /dev/null + chown root:lxdm /etc/lxdm/lxdm.conf > /dev/null + chown -R root:lxdm /var/lib/lxdm > /dev/null + chown -R root:lxdm /var/run/lxdm > /dev/null +} + +post_remove() { + # Removing lxdm group+user + getent passwd lxdm >/dev/null 2>&1 && userdel lxdm #|| /bin/true + getent group lxdm >/dev/null 2>&1 && groupdel lxdm #|| /bin/true +} |