/etc/init.d/gdm restart - from logged in user

waffe used Ask the Experts™

I need to restart gdm from a user that is logged into the GUI account. Meaning I have the command in a gnome-panel button:

sudo /etc/init.d/gdm restart

when I run this command the session logs out but never back in. Is there a way around this problem?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
evilrixSenior Software Engineer (Avast)

You are restarting X when you do that so all sessions will be logged out.


Basically I'm looking for a way log out and back in with being asked for a password.

I have auto login setup but when I logout I am asked for the password - is there a way to skip the password promt?
If you are running Ubuntu 9.04, you already have in the panel the quickstart icon which allows you to restart the session (X/gdm).
How to Generate Services Revenue the Easiest Way

This Tuesday! Learn key insights about modern cyber protection services & gain practical strategies to skyrocket business:

- What it takes to build a cloud service portfolio
- How to determine which services will help your unique business grow
- Various use-cases and examples

Try to press Ctrl+Alt+Backspace, it will restart X-Windows.

try to use in such way with screen:

$screen sudo /etc/init.d/gdm restart
I had to setup the auto login to 1 sec (had to modify that file directly). This worked but then I had an issue with the wireless network asking for the login password on every auto login.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial