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
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.
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).
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 ----------
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)