Change machines-start functionning
This commit is contained in:
parent
fb819b7b9e
commit
5e2e981cba
@ -12,7 +12,8 @@ All running Nspawn containers are stopped, snapshoted (using Btrfs subvolumes) a
|
||||
* `variables.conf.template` contains examples variables definitions, and should be copied locally to `variables.conf`
|
||||
(with any required modifications).
|
||||
* `systemd-templates/` contains Systemd units templates for running the scripts unattended.
|
||||
* specifically, `machines-start.timer` is a daily permanent trigger to start all enabled containers.
|
||||
* specifically, `machines-start.timer` and `machines-start.service` form a daily permanent trigger to start all
|
||||
enabled containers.
|
||||
#### Installation
|
||||
* `install.sh` script copies Systemd templates to their destination, and enables conts-snap and docker-upgrade timer.
|
||||
|
||||
|
@ -21,6 +21,7 @@ $sudo cp systemd-templates/cont-snap@.service /etc/systemd/system/
|
||||
$sudo cp systemd-templates/conts-snap.service /etc/systemd/system/
|
||||
$sudo sed -i -e "s:PH_DIRECTORY:$run_directory:g" /etc/systemd/system/conts-snap.service
|
||||
$sudo cp systemd-templates/conts-snap.timer /etc/systemd/system/
|
||||
$sudo cp systemd-templates/machines-start.service /etc/systemd/system/
|
||||
$sudo cp systemd-templates/machines-start.timer /etc/systemd/system/
|
||||
if [ $docker -eq 1 ]; then
|
||||
$sudo cp systemd-templates/docker-upgrade.service /etc/systemd/system/
|
||||
|
6
systemd-templates/machines-start.service
Normal file
6
systemd-templates/machines-start.service
Normal file
@ -0,0 +1,6 @@
|
||||
[Unit]
|
||||
Description=Force start machines.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/systemctl start machines.target
|
@ -2,7 +2,7 @@
|
||||
Description=Make sure containers are started after snapshoting
|
||||
|
||||
[Timer]
|
||||
Unit=machines.target
|
||||
Unit=machines-start.service
|
||||
OnCalendar=*-*-* 04:15:00
|
||||
Persistent=true
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user