PDA

View Full Version : How to prevent user from login before the Ethernet is fully established?



phu004
January 16th, 2014, 05:11 AM
Hi guys,

I have a customized Ubuntu system (based on a 64bits 13.10 release) which is configured to accept users on a ldap server and mount their home drive from afs. Everything is working except after a fresh boot, if the a user attempts to login before the wired connection icon changes to "connected", there is a good chance to crash the session for that user.

I wonder if there is anyway to make the login box appear after the Ethernet connection is fully established?

Thanks in advance!

ian-weisser
January 16th, 2014, 01:02 PM
Sure, one way is to add an Upstart condition.
The login screen is owned by lightdm.
Lightdm's start criteria is in /etc/init/lightdm.conf:

start on ((filesystem
and runlevel [!06]
and started dbus
and plymouth-ready)
or runlevel PREVLEVEL=S)


Add a stanza to the logic for network (let's assume eth0):


start on ((filesystem
and runlevel [!06]
and started dbus
and plymouth-ready
and net-device-up IFACE=eth0)
or (runlevel PREVLEVEL=S
and net-device-up IFACE=eth0))




Warning: I have not tested it.

sisco311
January 16th, 2014, 01:39 PM
You should create a .override file instead of editing directly the .conf file. See: http://upstart.ubuntu.com/cookbook/

ian-weisser
January 16th, 2014, 06:47 PM
Excellent point! Quite right.