Skip to content

Commit

Permalink
contrib: dracut: zfs-snapshot-bootfs: exit status fix
Browse files Browse the repository at this point in the history
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 openzfs#13359.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Gregory Bartholomew <gregory.lee.bartholomew@gmail.com>
Closes openzfs#13769
  • Loading branch information
gregory-lee-bartholomew authored and andrewc12 committed Sep 23, 2022
1 parent 3497431 commit 64f6e1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 64f6e1d

Please sign in to comment.