From 124054eeba2f9a5c65bfdfdbf59e257963025b24 Mon Sep 17 00:00:00 2001 From: Geoffrey Grosenbach Date: Thu, 25 Jan 2018 15:38:33 -0800 Subject: [PATCH] Ensure that webapp starts on reboot --- assets/setup-web.sh | 2 ++ assets/webapp.service | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/assets/setup-web.sh b/assets/setup-web.sh index 1a0ae95..edea516 100755 --- a/assets/setup-web.sh +++ b/assets/setup-web.sh @@ -4,3 +4,5 @@ cp /tmp/assets/webapp /usr/local/bin/ chmod +x /usr/local/bin/* cp /tmp/assets/webapp.service /lib/systemd/system/webapp.service service webapp start +systemctl enable webapp + diff --git a/assets/webapp.service b/assets/webapp.service index c28fb12..5455a0e 100644 --- a/assets/webapp.service +++ b/assets/webapp.service @@ -1,3 +1,6 @@ +[Install] +WantedBy=multi-user.target + [Unit] Description=Demo web app @@ -5,4 +8,5 @@ Description=Demo web app ExecStart=/usr/local/bin/webapp >> /var/log/webapp.log IgnoreSIGPIPE=false KillMode=process +Restart=on-failure