[CentOS] Making systemd start a service after sshd?

Fri Feb 20 20:07:58 UTC 2015
Bryan Wright <bkw1a at virginia.edu>

Hi again,

I'm starting to get to the bottom of it.  It looks like the file in
/etc/systemd/system is being ignored.  I noticed this when I did a:

systemctl show -p "After" lightdm.service

and saw that it didn't show sshd.service as a depencency.  After editing the
original copy of lightdm.service in /usr/lib/systemd/system and adding
sshd.service there, things work as expected.

Now the question is why does /etc/systemd/system/lightdm.service get
ignored?  Ahh!  I think I see the answer to that, too.  It looks like this
directory contains a symbolic link called dislay-manager.service which
points to the original lightdm.service.  The thing that's being started at
boot time is "display-manager.service"!

Yep, that does seem to be the case:
I put the original lightdm.service back to its pristine state, made
/etc/systemd/system/display-manager.service a symlink to my modified
lightdm.service file in /etc/systemd/system and rebooted, and things work as
expected.

Now my only worry is that this symlink will get pointed back at the original
file the next time an updated lightdm is installed....

Bryan