From 7f865f525b1265e8929923d851cb2068b5fdbb04 Mon Sep 17 00:00:00 2001 From: tengel Date: Sat, 23 Jan 2016 10:52:11 -0600 Subject: [PATCH] rebuild of systemd design --- systemd/petrified.target | 2 -- systemd/petrified.timer | 7 ------- systemd/petrified@.service | 11 ----------- systemd/system/petrified.service | 32 ++++++++++++++++++++++++++++++++ systemd/system/petrified.target | 10 ++++++++++ systemd/system/petrified.timer | 19 +++++++++++++++++++ systemd/user/petrified.service | 32 ++++++++++++++++++++++++++++++++ systemd/user/petrified.target | 10 ++++++++++ systemd/user/petrified.timer | 19 +++++++++++++++++++ 9 files changed, 122 insertions(+), 20 deletions(-) delete mode 100644 systemd/petrified.target delete mode 100644 systemd/petrified.timer delete mode 100644 systemd/petrified@.service create mode 100644 systemd/system/petrified.service create mode 100644 systemd/system/petrified.target create mode 100644 systemd/system/petrified.timer create mode 100644 systemd/user/petrified.service create mode 100644 systemd/user/petrified.target create mode 100644 systemd/user/petrified.timer diff --git a/systemd/petrified.target b/systemd/petrified.target deleted file mode 100644 index 6806054..0000000 --- a/systemd/petrified.target +++ /dev/null @@ -1,2 +0,0 @@ -[Unit] -Description=Run Petrified Instanced Units via timers diff --git a/systemd/petrified.timer b/systemd/petrified.timer deleted file mode 100644 index 715a9bc..0000000 --- a/systemd/petrified.timer +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Daily petrified update - -[Timer] -OnCalendar=daily -AccuracySec=1h -Persistent=true diff --git a/systemd/petrified@.service b/systemd/petrified@.service deleted file mode 100644 index c375649..0000000 --- a/systemd/petrified@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Run petrified as %i -After=network-online.target - -[Service] -Type=oneshot -ExecStart=/usr/bin/petrified -User=%i - -[Install] -WantedBy=petrified.target diff --git a/systemd/system/petrified.service b/systemd/system/petrified.service new file mode 100644 index 0000000..6922ed6 --- /dev/null +++ b/systemd/system/petrified.service @@ -0,0 +1,32 @@ +# +# /usr/lib/systemd/system/petrified.service +# +# This unit is intended for out-of-the-box turnkey operation +# and runs as the root user using the predefined defaults for +# files and directories in /etc/petrified.conf +# +# The provided petrified.timer unit is what should be enabled, +# not this service unit file directly: +# +# systemctl start petrified.timer +# systemctl enable petrified.timer +# + +[Unit] +Description=Run petrified in system mode +After=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 + diff --git a/systemd/system/petrified.target b/systemd/system/petrified.target new file mode 100644 index 0000000..49f5c61 --- /dev/null +++ b/systemd/system/petrified.target @@ -0,0 +1,10 @@ +# +# /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 + diff --git a/systemd/system/petrified.timer b/systemd/system/petrified.timer new file mode 100644 index 0000000..aaf8c9d --- /dev/null +++ b/systemd/system/petrified.timer @@ -0,0 +1,19 @@ +# +# /usr/lib/systemd/system/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 + +[Timer] +Unit=petrified.service +OnCalendar=6h +AccuracySec=1h +Persistent=true + +[Install] +WantedBy=multi-user.target + diff --git a/systemd/user/petrified.service b/systemd/user/petrified.service new file mode 100644 index 0000000..b586596 --- /dev/null +++ b/systemd/user/petrified.service @@ -0,0 +1,32 @@ +# +# /usr/lib/systemd/user/petrified.service +# +# This unit is intended for out-of-the-box turnkey operation +# and runs as the user using the predefined defaults for +# files and directories in $HOME/.petrifiedrc +# +# The provided petrified.timer unit is what should be enabled, +# not this service unit file directly: +# +# systemctl --user start petrified.timer +# systemctl --user enable petrified.timer +# + +[Unit] +Description=Run petrified as %u +After=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 + diff --git a/systemd/user/petrified.target b/systemd/user/petrified.target new file mode 100644 index 0000000..184f036 --- /dev/null +++ b/systemd/user/petrified.target @@ -0,0 +1,10 @@ +# +# /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 + diff --git a/systemd/user/petrified.timer b/systemd/user/petrified.timer new file mode 100644 index 0000000..981f8b2 --- /dev/null +++ b/systemd/user/petrified.timer @@ -0,0 +1,19 @@ +# +# /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 +OnCalendar=6h +AccuracySec=1h +Persistent=true + +[Install] +WantedBy=multi-user.target +