Here's what I have now:
I copied /usr/share/gdm/defaults.conf to another location that I have control over and modified it to use automatic login:
Code:
...
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=YOUR_LOGIN_HERE
...
Then, I copied /etc/init.d/gdm to another location I can control, and hacked it up to get only the stop and start pieces. It doesn't need to handle "start" or "stop" arguments any more because to won't be part of the rcX.d setup; I'll only call it from my remote SSH session.
Code:
#!/bin/bash
set -o errexit
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/gdm
CONFIG=/YOUR/CUSTOM/GDM/CONFIG/FILE.conf
test -x $DAEMON || exit 0
if [ -r /etc/default/locale ]; then
source /etc/default/locale
export LANG LANGUAGE
fi
source /lib/lsb/init-functions
# Stop GDM, as would be done in /etc/init.d/gdm
# ---------------------------------------------
log_daemon_msg "Stopping GNOME Display Manager" "gdm"
set +o errexit
start-stop-daemon --stop --quiet --pidfile /var/run/gdm.pid \
--name gdm --retry 5
set -o errexit
log_end_msg $?
# Start GDM, but have it use a custom config file, so that
# autologin is turned on for root
# --------------------------------------------------------
log_daemon_msg "Starting GNOME Display Manager" "gdm"
start_daemon $DAEMON --config $CONFIG
log_end_msg $?
exit 0
So, now, I can just run this script, and it'll start gdm with a custom configuration that causes it to log in automatically. From there, I can start Axeda Desktop Server remotely (making sure DISPLAY is set to :0.0 before starting it), and it works fine. Problem solved....
Well... no, it's not quite solved. There's still one huge problem.
I didn't explain one of my constraints very well. This computer is intended to be embedded into a medical device, and it has a highly-customized version of Debian 5.0 on it. One of the customizations is that most of the filesystem is mounted read-only, to prevent tampering (apparently, or something like that), including the /etc directory. It's actually worse than just being read-only, it's a union mount from a number of different places. The only user that can be logged in right now is root, and no more can be added, because /etc/passwd is part of the read-only filesystem. I can actually hack this by remounting it read-write, but I can't do this for the final product.
The kicker is that gdm does not allow you to use root as the account to be automatically logged in.
Any ideas? Please? *makes an extremely sad face*
But at least if someone else runs into the same problem up to but not including having to use root, then this should work.
(I don't feel like debating how dangerous and/or stupid it is to only have root available to log in with. I tend to agree, but it's out of my hands.)
Bookmarks