My goal is to better understand how things are working.
OK, so .. If I understand correctly:
- /etc/inittab specifies the default runlevel, in our case 5 and runs level S ( links in /etc/rcS.d)
- when entering runlevel 5, /etc/init.d/rc runs links named"SXXscriptname" in /etc/rc5.d
(links pointing to script files in /etc/init.d )
- one of the scripts is handling the display manager (start/stop service)
I'm using lightdm & Mate, but xfce is easier to start, therefore I tried this:
- renamed S21lightdm to K21lightdm in /etc/rc5.d and /etc/rcS.d
- Made a copy of /etc/init.d/lightdm script named nodm in the original directory
- added a link to nodm in /etc/rc5.d
- run 'update-rc.d lightdm defaults' and 'update-rc.d nodm defaults' as root
- edited the nodm script:
Code: Select all
#! /bin/sh
### BEGIN INIT INFO
# Provides: no dm
# Should-Start: console-screen kbd acpid dbus hal consolekit
# Required-Start: $local_fs $remote_fs x11-common
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: No Display Manager
# Description: Debian init script for No Display Manager
### END INIT INFO
#
# Author: Eperbab
#
#
echo"No DM"
set -e
PATH=/sbin:/bin:/usr/sbin:/usr/bin
#/bin/su - enzo -c"sudo -n startxfce4"
#exec sudo -u enzo startxfce4
#exec startxfce4
/bin/su - enzo -c"startxfce4"
exit 0
Now I have the following problems:
- /bin/su - enzo -c"sudo -n startxfce4" will not start xfce, because user 'enzo' needs to be prompted for sudo, -n not supported
- exec sudo -u enzo startxfce4 will not start xfce, because user 'enzo' doesn't have the privilege to start X
- /bin/su - enzo -c"startxfce4" will not start xfce, because user 'enzo' doesn't have the privilege to start X
- exec startxfce4 starts XFCE .. as root. I don't want to surf the web as superuser.
Interestingly, If I log in to console as 'enzo', and run startxfce4 from there without sudo, then it starts propely.
I guess it has something to do with duplicated lightdm start in rcS.d and rc5.d, and I need some orientation at this point.
(help, please.. )
*** Update: Since I am able to manually start xfce/mate from tty1, I decided to modify the nodm script, so it logs in to tty1 as user.
Code: Select all
#! /bin/sh
### BEGIN INIT INFO
# Provides: no dm
# Should-Start: console-screen kbd acpid dbus hal consolekit
# Required-Start: $local_fs $remote_fs x11-common
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: No Display Manager
# Description: Debian init script for No Display Manager
### END INIT INFO
#
# Author: Eperbab
echo"No DM"
set -e
PATH=/sbin:/bin:/usr/sbin:/usr/bin
/bin/login -f enzo tty1 </dev/tty1 >/dev/tty1 2>&1
exit 0
Code: Select all
if ["$(tty)" ="/dev/tty1" ] ; then
startx
fi
Now if - after restarting PC - I start xfce, then mate also starts.
And the"switch off" button is greyed out. I can only log out.
Any idea?