kdave / btrfsmaintenance

Scripts for btrfs maintenance tasks like periodic scrub, balance, trim or defrag on selected mountpoints or directories.
GNU General Public License v2.0
897 stars 79 forks source link

Switch btrfs-* services to Type=exec #118

Open karlmistelberger opened 5 months ago

karlmistelberger commented 5 months ago

Type=simple causes trouble with After=... ordering of systemd services. Type=exec will repair ordering issue.

lkraav commented 5 months ago

Type=simple causes trouble with After=... ordering of systemd services. Type=exec will repair ordering issue.

What's the trouble?

karlmistelberger commented 2 weeks ago

The behaviour is explained here: https://unix.stackexchange.com/questions/705839/systemd-firewall-service-unit-type-exec-or-type-oneshot

Mutually exclusive services will collide when declared simple. The will chain if declared exec or oneshot:

6700k:~ # grep -r =oneshot /etc/
/etc/systemd/system/dup.service:Type=oneshot
/etc/systemd/system/btrbk.service:Type=oneshot
/etc/systemd/system/btrfs-scrub.service.d/override.conf:Type=oneshot
/etc/systemd/system/btrfs-balance.service.d/override.conf:Type=oneshot
6700k:~ #