Dumb CentOS 7 Question

Home » CentOS » Dumb CentOS 7 Question
CentOS 11 Comments

How do you restart Xorg? I can’t find a target for it, and restarting graphical.target doesn’t seem to do it.

mark

11 thoughts on - Dumb CentOS 7 Question

  • Or just _kill_ gdm, and the session should automatically restart. At least I beleive so. Not going to try it until _after_ sending this message. :)

  • Richard wrote:

    Nope. I want runlevel 5. As I said, I tried starting the graphical.target, but I didn’t see Xorg start.

    Note that a reboot did restart it… but I should *not* have to do that.

    mark

  • Gordon Messmer wrote:

    Really? There’s no systemd target to restart it, and graphical.target doesn’t do it? Um…..

    mark

  • Why do you think that?

    # systemctl status gdm.service gdm.service – GNOME Display Manager
    Loaded: loaded (/usr/lib/systemd/system/gdm.service; enabled)
    Active: active (running) since Sun 2015-11-01 17:15:13 UTC; 1 months
    13 days ago
    Process: 1477 ExecStartPost=/bin/bash -c TERM=linux /usr/bin/clear >
    /dev/tty1 (code=exited, status=0/SUCCESS)
    Main PID: 1391 (gdm)
    CGroup: /system.slice/gdm.service
    ├─ 1391 /usr/sbin/gdm
    ├─21476 /usr/libexec/gdm-simple-slave –display-id
    /org/gnome/DisplayManager/Displays/_0
    └─21481 /usr/bin/Xorg :0 -background none -verbose -auth
    /run/gdm/auth-for-gdm-oJdseR/database -seat seat0 -nolisten tcp vt1

    # systemctl restart gdm.service

  • Gordon Messmer wrote:

    Sorry, I would have thought that graphical.target would do it. And suppose I’m using kdm…?

    mark

  • systemctl list-unit-files and look for kdm or something reasonable.

    —– Original Message —–
    From: “m roth”
    To: “CentOS mailing list”
    Sent: Tuesday, December 15, 2015 2:30:45 PM
    Subject: Re: [CentOS] Dumb CentOS 7 question

    Gordon Messmer wrote:

    Sorry, I would have thought that graphical.target would do it. And suppose I’m using kdm…?

    mark

  • I can’t even figure out what KDE calls the package that includes KDM, so I can’t tell you what the unit is called, but if its anything like GDM or LightDM, you can restart it by running:

    systemctl restart display-manager.service

    The installer for GDM and LightDM links
    /etc/systemd/system/display-manager.service to whatever the unit file is for the *DM service.

  • In general, you don’t start or restart targets; you “isolate” them, which means ‘anything that isn’t in this target should stop and anything that is should start’. You can do `systemctl isolate multi-user.target` and then `systemctl isolate graphical.target`
    (although beware that the former can and probably will kill your session.) I guess this is reasonably analogous to doing “telinit 3” and then “telinit 5”.

    In fact, “telinit 3” and then “telinit 5” should work basically as expected under systemd — they will isolate multi-user.target and graphical.target, respectively.

  • Matthew Miller wrote:

    Ok, thanks muchly. Next time my user has this problem (and he’s using a server as a desktop, what with the videous, and the *two* Tesla K-80’s in the box, and the weird remote over fibre to a video card we put in….)

    mark