]> git.proxmox.com Git - mirror_zfs.git/commitdiff
contrib: dracut: zfs-snapshot-bootfs: exit status fix
authorgregory-lee-bartholomew <gregory.lee.bartholomew@gmail.com>
Fri, 12 Aug 2022 21:28:15 +0000 (16:28 -0500)
committerGitHub <noreply@github.com>
Fri, 12 Aug 2022 21:28:15 +0000 (14:28 -0700)
When the zfs-snapshot-bootfs service attempts to create a snapshot
that already exists, the exit status of the command is non-zero and
the service reports failed to the systemd service manager. This is a
common occurrence if bootfs.snapshot is left set on the kernel command
line and it should not be considered a failure.

This service was originally set to ignore this error by prefixing
the command with - on the ExecStart line, but the leading - appears
to have been dropped in #13359.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Gregory Bartholomew <gregory.lee.bartholomew@gmail.com>
Closes #13769

contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in

index befd163b65369f4b085311c844d3dcfa78cc8cf7..9e73d1a787243fb1129838f86557462b948ccf9b 100644 (file)
@@ -8,5 +8,5 @@ ConditionKernelCommandLine=bootfs.snapshot
 
 [Service]
 Type=oneshot
-ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS"; SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$root@${SNAPNAME:-%v}"'
+ExecStart=-/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS"; SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$root@${SNAPNAME:-%v}"'
 RemainAfterExit=yes