6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-14 06:58:21 +00:00

Switch from supervisor to systemd for AWS deployment

This commit is contained in:
Régis Behmo 2019-03-11 18:47:33 +01:00
parent 20b77f6d5e
commit 285c75a1f0

View File

@ -13,8 +13,7 @@ sudo apt update \
ca-certificates \ ca-certificates \
curl \ curl \
gnupg-agent \ gnupg-agent \
software-properties-common \ software-properties-common
supervisor
echo "=============== Installing docker" echo "=============== Installing docker"
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 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 tutor webui start' | sudo tee /usr/local/bin/tutor-webui
sudo chmod +x /usr/local/bin/tutor-webui sudo chmod +x /usr/local/bin/tutor-webui
echo "=============== Configuring supervisor" echo "=============== Configuring systemd"
echo "[program:tutor] echo "[Unit]
command=/usr/local/bin/tutor-webui Description=Tutor web UI
environment=HOME=/home/$TUTOR_USER After=network.target
autorestart=true
user=$TUTOR_USER" | sudo tee /etc/supervisor/conf.d/tutor.conf [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