rebuild systemd to use timers.target and BINDIR templates

This commit is contained in:
troyengel 2017-11-19 10:09:19 -06:00
parent de91e17240
commit 1ef76d3e40
7 changed files with 33 additions and 82 deletions

View file

@ -15,18 +15,9 @@
[Unit]
Description=Run petrified in system mode
After=network-online.target
Requisite=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/petrified -c /etc/petrified.conf
# A target is being provided in the case where the advanced
# admin wants to override this unit with multiple config files
# for multiple interfaces. In this use case, *both* the custom
# service units and the timer are enabled with systemctl (as each
# custom unit will not be called "petrified.service", instead
# something like "petrified-wlp3s0.service")
[Install]
WantedBy=petrified.target
ExecStart=@BINDIR@/petrified -c /etc/petrified.conf

View file

@ -15,18 +15,9 @@
[Unit]
Description=Run petrified as %u
After=network-online.target
Requisite=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/petrified -c "%h/.petrifiedrc"
# A target is being provided in the case where the advanced
# admin wants to override this unit with multiple config files
# for multiple interfaces. In this use case, *both* the custom
# service units and the timer are enabled with systemctl (as each
# custom unit will not be called "petrified.service", instead
# something like "petrified-wlp3s0.service")
[Install]
WantedBy=petrified.target
ExecStart=@BINDIR@/petrified -c "%h/.petrifiedrc"

View file

@ -15,5 +15,4 @@ OnCalendar=0/6:00:00
Persistent=true
[Install]
WantedBy=multi-user.target
WantedBy=timers.target

View file

@ -1,10 +0,0 @@
#
# /usr/lib/systemd/system/petrified.target
#
# Note: If using a target to run mutliple service units, remember
# to enable both the multiple unit files and the single timer.
#
[Unit]
Description=Petrified units via timers

View file

@ -1,10 +0,0 @@
#
# /usr/lib/systemd/user/petrified.target
#
# Note: If using a target to run mutliple service units, remember
# to enable both the multiple unit files and the single timer.
#
[Unit]
Description=Petrified units via timers as %u

View file

@ -1,19 +0,0 @@
#
# /usr/lib/systemd/user/petrified.timer
#
# Note: Only one timer is needed if running multiple service
# units for multiple interfaces. No need to duplicate.
#
[Unit]
Description=Petrified update every 6 hours as %u
[Timer]
Unit=petrified.service
OnActiveSec=0s
OnCalendar=0/6:00:00
Persistent=true
[Install]
WantedBy=multi-user.target