From 3b0ecb25bf5e032b5cc0232040fca854f01d297b Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Thu, 25 May 2023 10:20:14 -0400 Subject: systemd fixes --- Makefile | 5 +++-- src/push-btrfs@.service | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f177968..f07bf3c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ config_dir = /etc/btrfs/remotes bindir = /usr/local/bin +unitdir = /etc/systemd/system main_unit_name = push-btrfs remotes = $(notdir $(basename $(wildcard $(config_dir)/*.json))) timers = $(addprefix $(main_unit_name)@, $(addsuffix .timer, $(remotes))) @@ -16,10 +17,10 @@ binaries = $(addprefix src/,push-btrfs retain-snapshots) - install: install -t $(bindir) -- $(binaries) - systemctl link $(addprefix ./, $(unit_files)) + install -m644 -t $(unitdir) -- $(unit_files) + systemctl daemon-reload systemctl reset-failed $(units) systemctl enable --now $(enable_unit) diff --git a/src/push-btrfs@.service b/src/push-btrfs@.service index 47a82ef..fcc7d72 100644 --- a/src/push-btrfs@.service +++ b/src/push-btrfs@.service @@ -1,10 +1,10 @@ [Unit] Description = Btrfs Backup over SSH ConditionUser = root -ConditionFileNotEmpty = /etc/btrfs/remotes/%I.json +ConditionFileNotEmpty = /etc/btrfs/remotes/%i.json [Service] -ExecStart = push-btrfs %I.json +ExecStart = push-btrfs %i.json [Install] WantedBy=default.target -- cgit v1.2.3