From 622de23541903f9b6f85fe0a96d61de08372d23b Mon Sep 17 00:00:00 2001 From: root Date: Fri, 10 Jun 2011 17:00:28 +0000 Subject: Fri Jun 10 17:00:28 UTC 2011 --- community/lxdm/lxdm.install | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 community/lxdm/lxdm.install (limited to 'community/lxdm/lxdm.install') diff --git a/community/lxdm/lxdm.install b/community/lxdm/lxdm.install new file mode 100644 index 000000000..8d42de90f --- /dev/null +++ b/community/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 +} -- cgit v1.2.3-54-g00ecf