Ordering of oneshot services and path units?
(too old to reply)
Andrei Borzenkov
2021-03-27 09:58:54 UTC
On 27.03.2021 10:11, John Ioannidis wrote:
*workdir.path *
Description=Trigger workdir.service when a job starts, creating a directory
in /opt/circleci/workdir
Huh?!?!?! It's supposed to run after ccistated, and of course after mktags
(highlighted in cyan above). It appears to be running anyway, and of course
mktags has not gotten a chance to finish, and the ConditionExists file has
not been created yet.
Do .path units not obey the same startup rules?
By default all path units have Before=paths.target dependency which puts
them before basic.target and all service units have default dependency
After=basic.target. So you have dependency loop which systemd needs to
break; results are unpredictable.

You will need DefaultDependencies=false in your path unit (and likely
usual Conflicts=shutdown.target in addition to make sure unit is stopped
on shutdown).