]> git.ipfire.org Git - thirdparty/systemd.git/commit
generators: when creating symlinks, silently ignore existing links in one more place
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 8 Sep 2025 17:47:28 +0000 (19:47 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 15 Sep 2025 09:11:01 +0000 (11:11 +0200)
commit8a9ab3dbbc86cf72ef8f511a3214f66a61f6bd01
treed688c544070cad5432572dafabd0e680acc36ede
parentbb4c00001d29151fc44267776c6099711eb4362d
generators: when creating symlinks, silently ignore existing links in one more place

After the update to systemd 257.7 in Fedora, there are reports that we fail to
create a symlink:
  systemd-gpt-auto-generator[585]: Failed to create symlink /run/systemd/generator/local-fs.target.wants/systemd-fsck-root.service: File exists
  (sd-exec-[574]: /usr/lib/systemd/system-generators/systemd-gpt-auto-generator failed with exit status 1.

I guess that some other generator created the symlink. We silently ignore
EEXIST in similar codepaths, so add that in one more place. (The target of the
symlink doesn't really matter. The name of the link matters. So something like
symlink_idempotent would not be better. For example, a different generator
might use a slightly different target path, and symlink_idempotent would be too
strict.)
src/shared/generator.c