From 285c75a1f02b4e0eb8cb365b1ecb14bf722e3385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Mon, 11 Mar 2019 18:47:33 +0100 Subject: [PATCH] Switch from supervisor to systemd for AWS deployment --- cloud/aws.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/cloud/aws.sh b/cloud/aws.sh index bc03e2a..114564b 100755 --- a/cloud/aws.sh +++ b/cloud/aws.sh @@ -13,8 +13,7 @@ sudo apt update \ ca-certificates \ curl \ gnupg-agent \ - software-properties-common \ - supervisor + software-properties-common echo "=============== Installing docker" curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - @@ -48,9 +47,18 @@ fi tutor webui start' | sudo tee /usr/local/bin/tutor-webui sudo chmod +x /usr/local/bin/tutor-webui -echo "=============== Configuring supervisor" -echo "[program:tutor] -command=/usr/local/bin/tutor-webui -environment=HOME=/home/$TUTOR_USER -autorestart=true -user=$TUTOR_USER" | sudo tee /etc/supervisor/conf.d/tutor.conf +echo "=============== Configuring systemd" +echo "[Unit] +Description=Tutor web UI +After=network.target + +[Service] +User=$TUTOR_USER +WorkingDirectory=/home/$TUTOR_USER +Environment="HOME=/home/$TUTOR_USER" +ExecStart=/usr/local/bin/tutor-webui +Restart=on-failure + +[Install] +WantedBy=multi-user.target" | sudo tee /etc/systemd/system/tutor-webui.service +sudo systemctl enable tutor-webui