Created
August 24, 2021 14:50
-
-
Save epcim/8e678d5b19719562735e923d7fe4c7d7 to your computer and use it in GitHub Desktop.
systemd.service and timer example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=KCD cron job | |
After=vpm.service | |
After=kubelet.service | |
[Service] | |
User=root | |
Type=oneshot | |
SyslogIdentifier=kcd | |
EnvironmentFile=-/etc/environment | |
EnvironmentFile=-/etc/default/kcd | |
ExecStartPre=-/bin/mkdir -p /var/lib/kcd | |
Restart=no | |
TimeoutStopSec=30 | |
TimeoutStartSec=30 | |
RemainAfterExit=no | |
TimeoutSec=120 | |
#Not supported by our version | |
#ExecCondition=/opt/bin/kcd version | |
ExecStart=/opt/bin/kcd \ | |
--verbose \ | |
--config /etc/kcd.yaml \ | |
cleanup | |
[Install] | |
WantedBy=multi-user.target | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Timer for KCD service | |
[Timer] | |
OnBootSec=30min | |
OnUnitActiveSec=1h | |
#OnCalendar=hourly | |
#Persistent=true | |
[Install] | |
WantedBy=timers.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment