From 18c2bb3223d8f1c585f831bce13c82d43d4988a4 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Wed, 12 Dec 2018 00:16:30 +0100 Subject: [PATCH] Move systemd-units to public dotfiles Signed-off-by: Knut Ahlers --- .../user/docker-compose-reload.service | 7 +++++++ .../systemd/user/docker-compose-reload.timer | 9 +++++++++ .config/systemd/user/docker-compose.service | 19 +++++++++++++++++++ .config/systemd/user/dropbox.service | 12 ++++++++++++ .config/systemd/user/ngrok.service | 13 +++++++++++++ .config/systemd/user/ssh-agent.service | 5 +++++ 6 files changed, 65 insertions(+) create mode 100644 .config/systemd/user/docker-compose-reload.service create mode 100644 .config/systemd/user/docker-compose-reload.timer create mode 100644 .config/systemd/user/docker-compose.service create mode 100644 .config/systemd/user/dropbox.service create mode 100644 .config/systemd/user/ngrok.service create mode 100644 .config/systemd/user/ssh-agent.service diff --git a/.config/systemd/user/docker-compose-reload.service b/.config/systemd/user/docker-compose-reload.service new file mode 100644 index 0000000..139361c --- /dev/null +++ b/.config/systemd/user/docker-compose-reload.service @@ -0,0 +1,7 @@ +[Unit] +Description=Refresh images and update containers + +[Service] +Type=oneshot + +ExecStart=/bin/systemctl --user reload-or-restart docker-compose.service diff --git a/.config/systemd/user/docker-compose-reload.timer b/.config/systemd/user/docker-compose-reload.timer new file mode 100644 index 0000000..d7ede77 --- /dev/null +++ b/.config/systemd/user/docker-compose-reload.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Refresh images and update containers +After=docker-compose.service + +[Timer] +OnCalendar=*:0/15 + +[Install] +WantedBy=timers.target diff --git a/.config/systemd/user/docker-compose.service b/.config/systemd/user/docker-compose.service new file mode 100644 index 0000000..e765093 --- /dev/null +++ b/.config/systemd/user/docker-compose.service @@ -0,0 +1,19 @@ +[Unit] +Description=Docker Compose container starter + +[Service] +WorkingDirectory=/home/luzifer/.config +Type=oneshot +RemainAfterExit=yes +Environment=DOCKER_HOST=http+unix://var/run/docker.sock + +ExecStartPre=/usr/bin/docker-compose pull --quiet --ignore-pull-failures +ExecStart=/usr/bin/docker-compose up -d --remove-orphans + +ExecStop=/usr/bin/docker-compose stop + +ExecReload=/usr/bin/docker-compose pull --quiet --parallel --ignore-pull-failures +ExecReload=/usr/bin/docker-compose up -d --remove-orphans + +[Install] +WantedBy=default.target diff --git a/.config/systemd/user/dropbox.service b/.config/systemd/user/dropbox.service new file mode 100644 index 0000000..ff1da7a --- /dev/null +++ b/.config/systemd/user/dropbox.service @@ -0,0 +1,12 @@ +[Unit] +Description=Dropbox + +[Service] +Type=simple +ExecStart=/home/luzifer/.dropbox-dist/dropboxd +ExecReload=/bin/kill -HUP $MAINPID +KillMode=process +Restart=on-failure + +[Install] +WantedBy=default.target diff --git a/.config/systemd/user/ngrok.service b/.config/systemd/user/ngrok.service new file mode 100644 index 0000000..86d7bbb --- /dev/null +++ b/.config/systemd/user/ngrok.service @@ -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 diff --git a/.config/systemd/user/ssh-agent.service b/.config/systemd/user/ssh-agent.service new file mode 100644 index 0000000..b10e016 --- /dev/null +++ b/.config/systemd/user/ssh-agent.service @@ -0,0 +1,5 @@ +[Service] +ExecStart=/usr/bin/ssh-agent -D -a "${HOME}/.ssh/ssh_auth_sock" + +[Install] +WantedBy=default.target