Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous warning when running via a systemd service with autorestic in the name #406

Open
PHLAK opened this issue Oct 25, 2024 · 0 comments

Comments

@PHLAK
Copy link

PHLAK commented Oct 25, 2024

Describe the bug

I'm setting up autorestic using systemd services/timers for automating my backups and have decided to name my service file autorestic-backup.service. When running the service a warning/error is displayed saying it found exiting autorestic processes and lists all processes with autorestic in the name. The list of processes shows the autorestic-backup.service processes but no actual autorestic process. It also shows a prompt to unlock followed by an "Unlocking aborted" message.

This doesn't seem to be preventing the service from running but it's erroneous since those services aren't pre-exising autorestic processes and there's no reason to show the message.

I haven't looked into the code but I'm guessing this is due to a naive check that's only looking for processes that contain the word autorestic.

Expected behavior

No warning/error should be shown.

Environment

  • OS: Arch Linux
  • Autorestic Version: 1.8.3

Additional context

Here's the contents of the autrestic-backup.service file.

[Unit]
Description=Run a backup
Requisite=network-online.target
ConditionACPower=true

[Service]
Type=oneshot
WorkingDirectory=/etc/autorestic
ExecStart=systemd-inhibit autorestic --ci --config config.yaml backup --all
Nice=19

And here's the log output from the service run.

Oct 25 09:23:34 Reflector systemd[1]: Starting Run the backups...
Oct 25 09:23:34 Reflector autorestic[346980]: Using config:          /etc/autorestic/config.yaml
Oct 25 09:23:34 Reflector autorestic[346980]: Using env:         /etc/autorestic/.autorestic.env
Oct 25 09:23:34 Reflector autorestic[346980]: Found autorestic processes:
Oct 25 09:23:34 Reflector autorestic[346980]: root      346974  9.0  0.0  17992  7296 pts/0    S+   09:23   0:00 sudo systemctl start autorestic-backup.service
Oct 25 09:23:34 Reflector autorestic[346980]: root      346976  0.0  0.0  17992  2496 pts/1    Ss   09:23   0:00 sudo systemctl start autorestic-backup.service
Oct 25 09:23:34 Reflector autorestic[346980]: root      346977  0.0  0.0  17808  6784 pts/1    S+   09:23   0:00 systemctl start autorestic-backup.service
Oct 25 09:23:34 Reflector autorestic[346980]: Another autorestic instance is running. Are you sure you want to unlock? (yes/no): Unlocking aborted.
Oct 25 09:23:34 Reflector systemd-inhibit[346995]: Using config:          /etc/autorestic/config.yaml
Oct 25 09:23:34 Reflector systemd-inhibit[346995]: Using env:         /etc/autorestic/.autorestic.env
Oct 25 09:23:34 Reflector systemd-inhibit[346995]: Using lock:         .autorestic.lock.yml
Oct 25 09:23:34 Reflector systemd-inhibit[346995]:     Backing up location "etc"
@PHLAK PHLAK changed the title Warning when running via a systemd service with autorestic in the name Erroneous warning when running via a systemd service with autorestic in the name Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant