From e2573c28f8da964f1816278e46a6f2e81b236429 Mon Sep 17 00:00:00 2001 From: "K. Isom" Date: Mon, 19 Apr 2021 21:26:55 -0700 Subject: [PATCH] Add Makefile and systemd unit file. --- Makefile | 16 ++++++++++++++++ kas.service | 10 ++++++++++ 2 files changed, 26 insertions(+) create mode 100644 Makefile create mode 100644 kas.service diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..36d89a2 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +all: + +update: refresh install + sudo systemctl restart kas.service + +refresh: + git pull --rebase + +install: + go build . + sudo mv kas /usr/local/bin/kas + +setup: + sudo install -m 0644 kas.service /etc/systemd/system/kas.service + sudo install -d 0700 /etc/kas + sudo install -m 0600 kas.yaml /etc/kas/kas.yaml diff --git a/kas.service b/kas.service new file mode 100644 index 0000000..d6ad05b --- /dev/null +++ b/kas.service @@ -0,0 +1,10 @@ +[Unit] +After=network.target +Description=Kyle's Agent System + +[Service] +ExecPre=test -f /etc/kas/kas.yaml +ExecStart=/usr/local/bin/kas -f /etc/kas/kas.yaml +Restart=on-failure +Group=daemon +User=daemon