-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
Improve systemd units #498
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
[Unit] | ||
Description=btrbk daily backup | ||
ConditionPathExists=|@CONFDIR@/btrbk/btrbk.conf | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it a good idea to set this in the timer as well? a user might want to override the service with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm... TBH, I'm not exactly sure how "bad" it is to run the time and let just the service not run because of the conditional. Probably not at all, and at most it would be "conceptually" ugly, i.e. when the timer is considered to have been fired, but the service actually didn't. On could argue, that if a user wants to override the So.. yeah... I have no real strong opinion about this. |
||
ConditionPathExists=|@CONFDIR@/btrbk.conf | ||
|
||
[Timer] | ||
OnCalendar=daily | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think daily is a good default. Some want it hourly, some daily, and I know (at least one) doing it minutely ;-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Forget about that commit... it was late in the night and I was pretty dumb ^^ I completely forgot that the times in the retention policies don't determine how often the tool runs, but how long the snapshots/etc. are kept... so It could however make sense, if somewhere we add the proper systemd way on how to override (described in systemd.unit(5)) the time, namely by adding a file:
|
||
AccuracySec=10min | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure myself why I set this, must have read something when initially playing around with btrbk and systemd. Guess the idea was to tell the timer it's ok to be delayed a bit, as there might be other concurrent btrbk timers running (e.g. with different config and execution times) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well then it depends: Was your idea to spread the time when these fire off (to not cause all load at the same time)? Then Otherwise, I, personally would say, I could update the commit with whatever you like in the end. (The |
||
OnCalendar=hourly | ||
Persistent=true | ||
|
||
[Install] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not using systemd myself, and my knowledge is a bit limited here (and no, not going to read through all the docs, all those options are one of the reasons for me not to use systemd).
This sounds like a good thing to have. does that mean that the service will not fail if the config file does not exist, even if you start it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, AFAIU, it should not fail (that would require an
AssertPathExists
).