0

I'm hoping that someone can point me in the correct direction on this.

I've got a new systemd Path Unit (see below) which is preventing the sshd.service from starting, as per the below "journalctl -u sshd" entries.

So obviously I've got something wrong, but I can't figure out what - Help! :-)

Thanks in advance

Journal:

Oct 10 17:08:28 host1.example.local systemd[1]: multi-user.target: Found ordering cycle on sshd.service/start
Oct 10 17:08:28 host1.example.local systemd[1]: multi-user.target: Found dependency on sshd-keygen.target/start
Oct 10 17:08:28 host1.example.local systemd[1]: multi-user.target: Found dependency on [email protected]
Oct 10 17:08:28 host1.example.local systemd[1]: multi-user.target: Found dependency on basic.target/start
Oct 10 17:08:28 host1.example.local systemd[1]: multi-user.target: Found dependency on paths.target/start
Oct 10 17:08:28 host1.example.local systemd[1]: multi-user.target: Found dependency on path-watch.path/start
Oct 10 17:08:28 host1.example.local systemd[1]: multi-user.target: Found dependency on multi-user.target/start
Oct 10 17:08:28 host1.example.local systemd[1]: multi-user.target: Job sshd.service/start deleted to break ordering cycle starting with multi-user.target/start

Path Unit File:

[Unit]
Description=Watch for changes (updates) to /mypath
Wants=network-online.target
After=multi-user.target

[Path] 
PathChanged=/mypath/

[Install]
WantedBy=multi-user.target

Edit: Also, if this should be posted elsewhere than a simple "Hey, you might get a better answer over on XYZ list" would be appreciated.

2 Answers 2

1

I think that the nub of the problem is that path units automatically have dependencies of type Before= on paths.target, so your unit is effectively configured to start Before paths.target and After multi-user.target (which is impossible, as the former is pretty early, and the latter is very late). You could try setting DefaultDependencies=no in the [Unit] section, though this seems to be frowned upon. It might be better to consider whether you really need your path unit to have the specified ordering relationship with multi-user.target.

1
  • Thanks - I knew I had something wrong :-)
    – Dulux-Oz
    Commented Oct 10, 2023 at 15:55
0

From the documentation of path units:

Default Dependencies

The following dependencies are added unless DefaultDependencies=no is set:

  • Path units will automatically have dependencies of type Before= on paths.target, [..]. Only path units involved with early boot or late system shutdown should disable DefaultDependencies= option.

So, this unit has the following ordering relations:

  • Before=paths.target
  • After=multi-user.target

But multi-user.target comes after basic.target, which comes after paths.target, which comes after this path unit, which comes after multi-user.target, which ….

1
  • Thanks - I knew I had something wrong :-)
    – Dulux-Oz
    Commented Oct 10, 2023 at 15:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .