Fedora Linux Support Community & Resources Center
  #1  
Old 1st September 2012, 09:16 PM
tusharkant15 Offline
Registered User
 
Join Date: Sep 2012
Location: India
Posts: 6
linuxfirefox
Restart GDM/X from command line

So here's how it's done(thanks to jpollard)

Quote:
sudo kill -9 $(ps -e | grep gdm-binary | cut -d' ' -f1)
Save it in a script. I have an alias in my ~/.bashrc with this

Quote:
Hi!
Yesterday I was working on my own extension for gnome and my computer froze. I could switch to other virtual consoles using Alt+Ctrl+F(2) but I couldn't figure out how to restart gdm. On debian I could do a "service restart gdm3", but couldn't find the equivalent systemd command. I tried "systemctl restart graphical.target" but with no luck I finally had to restart my system(not an issue coz my system boots in like 6 seconds thanks to systemd )

I love the whole concept of systemd and the only thing that would make it better is more pratical documentation.

Thanks
(PS: It's my first post on any linux forum!!)

Last edited by tusharkant15; 3rd September 2012 at 07:30 PM. Reason: Final
Reply With Quote
  #2  
Old 1st September 2012, 09:26 PM
nonamedotc Offline
Community Manager
 
Join Date: Mar 2011
Location: USA
Posts: 3,859
linuxfedorafirefox
Re: Restart GDM/X from command line

Did you try
Code:
startx
This works for me when I try what you have described (other than the coding part )
Reply With Quote
  #3  
Old 1st September 2012, 09:43 PM
tusharkant15 Offline
Registered User
 
Join Date: Sep 2012
Location: India
Posts: 6
linuxfirefox
Re: Restart GDM/X from command line

Nope, it starts a new gnome-session on a sepperate VC.

Thanks anyways coz I din't knwo how to start a graphical session with root!!

This is what I love about linux, you look for one thing and you find the answers to many!
Reply With Quote
  #4  
Old 1st September 2012, 09:44 PM
nonamedotc Offline
Community Manager
 
Join Date: Mar 2011
Location: USA
Posts: 3,859
linuxfedorafirefox
Re: Restart GDM/X from command line

Quote:
Originally Posted by tusharkant15 View Post
Nope, it starts a new gnome-session on a sepperate VC.

Thanks anyways coz I din't knwo how to start a graphical session with root!!

This is what I love about linux, you look for one thing and you find the answers to many!
oh yes! I was so wrong! I somehow did not notice that at all! Thanks
Reply With Quote
  #5  
Old 2nd September 2012, 02:40 AM
hadrons123 Offline
'The Blue Dragon'
 
Join Date: Jan 2011
Location: Pitt,PA
Posts: 1,260
linuxfirefox
Re: Restart GDM/X from command line

For systemd
Code:
systemctl restart gdm.service
should restart gdm.
__________________
LENOVO Y580 FHD Intel® Core™ i7-3630QM CPU @ 2.40GHz × 8 |660M GTX NVIDIA | 16 GB SSD
Reply With Quote
  #6  
Old 3rd September 2012, 11:46 AM
tusharkant15 Offline
Registered User
 
Join Date: Sep 2012
Location: India
Posts: 6
linuxfirefox
Re: Restart GDM/X from command line

Thanks for replying there is no gdm service. The only thing remotely related to GUI is graphical.target. The output of your command is :

Quote:
systemctl restart gdm.service
[sudo] password for tushar:
Failed to issue method call: Unit gdm.service failed to load: No such file or directory. See system logs and 'systemctl status gdm.service' for details.
Reply With Quote
  #7  
Old 3rd September 2012, 01:04 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,870
linuxfirefox
Re: Restart GDM/X from command line

The simple way to restart gdm is "killall gdm" (you might have to put a "-s 9" to force it to exit).

systemd will restart it when it terminates.

Normally though, no extension to gnome requires this UNLESS you are modifying low level libraries. This is because gdm is nothing more than a login handler using gtk for display access.

Working on extensions to gnome-shell (more likely) should only need gnome-shell to be restarted (logout/login or directing gnome-shell to restart).
Reply With Quote
  #8  
Old 3rd September 2012, 07:15 PM
tusharkant15 Offline
Registered User
 
Join Date: Sep 2012
Location: India
Posts: 6
linuxsafari
Re: Restart GDM/X from command line

Thanks....I'm not at the computer right now....will try it when I'm back.....I don't need it for the extension, I was just working on one and it froze up my system....I'm writing an extension to show a simple workspace switcher without going into overlay mode (if anyone is interested)

---------- Post added at 11:45 PM ---------- Previous post was at 06:00 PM ----------

Hey it works!!
Reply With Quote
  #9  
Old 4th September 2012, 12:41 AM
secipolla Offline
Registered User
 
Join Date: May 2011
Posts: 700
linuxfirefox
Re: Restart GDM/X from command line

A way to stop the graphical target is
systemctl isolate multi-user.target (or just init 3)
then
systemctl isolate graphical.target (or default.target or init 5)
Reply With Quote
Reply

Tags
command, gdm or x, line, restart

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Current GMT-time: 09:52 (Friday, 31-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Palmaner Travel Photos - Karanja Travel Photos on Instagram - Ribera Photos on Instagram