-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
Hi all,
Just really adding this here as a helper for anyone looking to implement on Linux using systems.
Not saying this is at all the correct way. I'm running this all through Saltstack so apologies if this isn't directly applicable.
Ive used a "runner" file to control the actions outside the processing script:
Changes to directory where the project is cloned, runs the script and generates a temporary file, moves it over the previous file were the webserver is looking.
#!/bin/bash
cd /home/vagrant/tinystatus
./tinystatus > /home/vagrant/tinystatus/index.html.tmp
mv /home/vagrant/tinystatus/index.html.tmp /var/www/tinystatus/index.html
Then I have a systemd service:
[Unit]
Description=Tinystatus reports availability of services
Wants=tinystatus.timer
[Service]
Type=simple
User=vagrant
Group=vagrant
ExecStart=/home/vagrant/tinystatus.runner.sh
[Install]
WantedBy=multi-user.target
And a systemd timer:
[Unit]
Description=Timer that periodically triggers tinystatus.service
Requires=tinystatus.service
[Timer]
OnCalendar=minutely
[Install]
WantedBy=timers.target
The service and timer are then enabled and timer started.
alexpovel, decaby7e, JanRK and voznik
Metadata
Metadata
Assignees
Labels
No labels