Add systemd user services

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-02-22 10:35:42 +01:00
parent c70e9dd605
commit 0ac1a7a7ee
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
6 changed files with 71 additions and 0 deletions

View file

@ -0,0 +1,7 @@
[Unit]
Description=Refresh images and update containers
[Service]
Type=oneshot
ExecStart=/bin/systemctl --user reload docker-compose.service

View file

@ -0,0 +1,10 @@
[Unit]
Description=Refresh images and update containers
Requires=docker-compose.service
After=docker-compose.service
[Timer]
OnCalendar=*:0/15
[Install]
WantedBy=timers.target

View file

@ -0,0 +1,18 @@
[Unit]
Description=Docker Compose container starter
[Service]
WorkingDirectory=/home/luzifer/.config
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/usr/local/bin/docker-compose pull --quiet --parallel --ignore-pull-failures
ExecStart=/usr/local/bin/docker-compose up -d --remove-orphans
ExecStop=/usr/local/bin/docker-compose down
ExecReload=/usr/local/bin/docker-compose pull --quiet --parallel --ignore-pull-failures
ExecReload=/usr/local/bin/docker-compose up -d --remove-orphans
[Install]
WantedBy=default.target

View file

@ -0,0 +1,13 @@
[Unit]
Description=ngrok port forwarding
[Service]
TimeoutStartSec=0
TimeoutStopSec=0
Restart=on-failure
RestartSec=5
ExecStartPre=/bin/bash -c 'if ! [ -e /home/luzifer/.bin/ngrok ]; then mkdir -p /home/luzifer/.bin && curl -sSLo /tmp/ngrok.zip https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip && unzip -q /tmp/ngrok.zip -d /home/luzifer/.bin && rm /tmp/ngrok.zip; fi'
ExecStart=/home/luzifer/.bin/ngrok start --none
[Install]
WantedBy=default.target

View file

@ -0,0 +1,11 @@
[Unit]
Description=Sparkyfish Server instance
[Service]
ExecStart=/home/luzifer/workspaces/private/go/bin/sparkyfish-server \
-cname workwork01.cloud.kserver.biz -location Hetzner
Restart=always
RestartSec=5
[Install]
WantedBy=default.target

View file

@ -0,0 +1,12 @@
[Unit]
Description=Service to renew local vault token
[Service]
Environment=VAULT_ADDR=https://vault.luzifer.io
Environment=VAULT_ROLE_ID=c5e0ef31-ffa3-d880-1386-e78ef74d14a7
ExecStart=/home/luzifer/gocode/bin/vault-user-token --log-level=debug --full-hostname=false
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target