On 4/28/20 5:36 PM, Thomas HUMMEL wrote:

3) regarding local-fs dans remote-fs targets : I'm not really sure if any fits in either passive or active units.

Hello again,

regarding local-fs.target : is it legit for a custom service unit to pull it in with a Before=local-fs.target (no Wants or Requires) ?

For instance, I did create a simple oneshot test service (dodo.service) which just sleeps 20s stating Before=local-fs.target. I did that to emulate another service I created which formats an ssd and locally mount it (but outside of fstab so it would not get the automatic ordering dependency that systemd-fstab-generator gives)

Note : this is on a statless host, so fstab states

rootfs / tmpfs defaults,size=3500M 0 0

1) it seem to create lots of ordering cycles like this one (among many)

dodo.service: Job systemd-tmpfiles-setup.service/start deleted to break ordering cycle starting with dodo.service/start

I can't really see why even if I see that systemd-tmpfiles-setup has also a Before=local-fs.target ordering dependency ?

2) given the job ultimately gets deleted because of this cycle, I cannot understand why it seems to be exectuted anyway :


[root@maestro-1002 systemd]# journalctl | grep -i systemd-tmpfiles-setup.service May 05 15:45:56 localhost systemd[1]: systemd-tmpfiles-setup.service: Installed new job systemd-tmpfiles-setup.service/start as 12 May 05 15:45:56 localhost systemd[1]: systemd-tmpfiles-setup.service: Passing 0 fds to service May 05 15:45:56 localhost systemd[1]: systemd-tmpfiles-setup.service: About to execute: /usr/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev May 05 15:45:56 localhost systemd[1]: systemd-tmpfiles-setup.service: Forked /usr/bin/systemd-tmpfiles as 863 May 05 15:45:56 localhost systemd[1]: systemd-tmpfiles-setup.service: Changed dead -> start May 05 15:45:56 localhost systemd[863]: systemd-tmpfiles-setup.service: Executing: /usr/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev May 05 15:45:57 localhost systemd[1]: systemd-tmpfiles-setup.service: Child 863 belongs to systemd-tmpfiles-setup.service. May 05 15:45:57 localhost systemd[1]: systemd-tmpfiles-setup.service: Main process exited, code=exited, status=0/SUCCESS May 05 15:45:57 localhost systemd[1]: systemd-tmpfiles-setup.service: Changed start -> exited May 05 15:45:57 localhost systemd[1]: systemd-tmpfiles-setup.service: Job systemd-tmpfiles-setup.service/start finished, result=done May 05 15:45:57 localhost systemd[1]: Got cgroup empty notification for: /system.slice/systemd-tmpfiles-setup.service May 05 15:46:31 maestro-1002.maestro.pasteur.fr systemd[1]: systemd-tmpfiles-setup.service: Changed dead -> exited


-> this seems to be like an actual run and not only the queuing of a job into the transaction which would be discarded afterwards when the cycle is discovered ?

However once the host booted, I can see that at least one tmpfile (in a tmpfiles.d config file) has indeed not be created as it should be (and as it actually is when /usr/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev is run manually).

May 05 15:46:32 maestro-1002.maestro.pasteur.fr systemd[1]: systemd-tmpfiles-setup.service: Installed new job systemd-tmpfiles-setup.service/stop as 84 May 05 15:46:32 maestro-1002.maestro.pasteur.fr systemd[1]: systemd-tmpfiles-setup.service: Changed exited -> dead May 05 15:46:32 maestro-1002.maestro.pasteur.fr systemd[1]: systemd-tmpfiles-setup.service: Job systemd-tmpfiles-setup.service/stop finished, result=done May 05 15:46:34 maestro-1002.maestro.pasteur.fr systemd[1]: dodo.service: Found dependency on systemd-tmpfiles-setup.service/start May 05 15:46:34 maestro-1002.maestro.pasteur.fr systemd[1]: dodo.service: Job systemd-tmpfiles-setup.service/start deleted to break ordering cycle starting with dodo.service/start May 05 15:51:45 maestro-1002 systemd[1]: Preset files say disable systemd-tmpfiles-setup.service.

Can you help me figure out my misunderstanding ?

Thanks for your help

--
Thomas HUMMEL

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to