Add systemd user services
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c70e9dd605
commit
0ac1a7a7ee
6 changed files with 71 additions and 0 deletions
7
.config/systemd/user/docker-compose-reload.service
Normal file
7
.config/systemd/user/docker-compose-reload.service
Normal file
|
@ -0,0 +1,7 @@
|
|||
[Unit]
|
||||
Description=Refresh images and update containers
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
||||
ExecStart=/bin/systemctl --user reload docker-compose.service
|
10
.config/systemd/user/docker-compose-reload.timer
Normal file
10
.config/systemd/user/docker-compose-reload.timer
Normal 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
|
18
.config/systemd/user/docker-compose.service
Normal file
18
.config/systemd/user/docker-compose.service
Normal 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
|
13
.config/systemd/user/ngrok.service
Normal file
13
.config/systemd/user/ngrok.service
Normal 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
|
11
.config/systemd/user/sparkyfish.service
Normal file
11
.config/systemd/user/sparkyfish.service
Normal 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
|
12
.config/systemd/user/vault-user-token.service
Normal file
12
.config/systemd/user/vault-user-token.service
Normal 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
|
Loading…
Reference in a new issue