[CentOS] Making systemd start a service after sshd?

Bryan Wright

bkw1a at virginia.edu
Fri Feb 20 18:50:11 UTC 2015


Hi folks,

        For complicated reasons, I'd like to have a service (lightdm) start
after sshd starts.  (This is on CentOS 7.)  I've tried adding "sshd.service"
to the lists of "Active=" and "Require=" items in
/etc/systemd/system/lightdm.service (which started as a copy of
/usr/lib/systemd/system/lightdm.service), but these changes don't seem to
have any effect.  Sshd still starts long after lightdm starts.

        Any suggestions?  For what it's worth, here's the entire
lightdm.service file:

[Unit]
Description=Light Display Manager
Documentation=man:lightdm(1)
Conflicts=getty at tty1.service
After=systemd-user-sessions.service getty at tty1.service plymouth-quit.service
livesys-late.service time-sync.target sshd.service
Require=time-sync.target sshd.service

[Service]
ExecStart=/usr/sbin/lightdm
Restart=always
IgnoreSIGPIPE=no
BusName=org.freedesktop.DisplayManager

[Install]
Alias=display-manager.service

        Thanks for any help.
        Bryan





More information about the CentOS mailing list