[systemd-devel] How do I easily resolve conflicting jobs in custom units?
Andrei Borzenkov
arvidjaar at gmail.com
Thu Mar 23 03:38:48 UTC 2017
22.03.2017 23:47, John Florian пишет:
> I build an mostly-stateless appliance OS derived from Fedora (25 ATM)
> and have several custom units to make it all possible. My units had
> worked great with F21, but are now giving me problems with F25. One
> pair of the custom units do some trickery to relocate sshd host keys
> from /etc/ssh to an alternate location that provides persistence:
>
> $ systemctl cat sshd-persist-keys.service
> # /usr/lib/systemd/system/sshd-persist-keys.service
> [Unit]
> Description=OpenSSH server - persist volatile keys for the AOS
> After=sshd-keygen.target
> Before=sshd.service
> Wants=sshd-keygen.target
>
> [Service]
> ExecStart=/usr/sbin/sshd-persist-keys
> Type=oneshot
> RemainAfterExit=yes
>
> [Install]
> WantedBy=multi-user.target
>
>
> $ systemctl cat sshd-restore-keys.service
> # /usr/lib/systemd/system/sshd-restore-keys.service
> [Unit]
> Description=OpenSSH server - restore persisted keys for the AOS
> After=aos-storage-init.service
> Before=sshd-keygen at rsa.service sshd-keygen at ecdsa.service sshd-keygen at ed
> 25519.service
>
> [Service]
> ExecStart=/usr/sbin/sshd-restore-keys
> Type=oneshot
> RemainAfterExit=yes
>
> [Install]
> WantedBy=multi-user.target
>
>
> I found that on some boots, sshd wasn't getting started. With the help
> of booting with systemd.log_level=debug I learned:
>
> $ sudo journalctl | grep conflict
Please make full log available as well as actual unit definitions that
are not started.
> Mar 22 16:11:42 localhost systemd[1]: sshd.service: Looking at job
> sshd.service/start conflicted_by=no
> Mar 22 16:11:42 localhost systemd[1]: sshd.service: Looking at job
> sshd.service/stop conflicted_by=yes
> Mar 22 16:11:42 localhost systemd[1]: sshd.service: Fixing conflicting
> jobs sshd.service/start,sshd.service/stop by deleting job
> sshd.service/start
More information about the systemd-devel
mailing list