diff --git a/etc/debian11/wrolpi-app.service b/etc/debian11/wrolpi-app.service new file mode 100644 index 00000000..4f6c5e49 --- /dev/null +++ b/etc/debian11/wrolpi-app.service @@ -0,0 +1,13 @@ +[Unit] +Description=WROLPi React APP +Wants=wrolpi-api.service +PartOf=wrolpi.target + +[Service] +ExecStart=/usr/local/bin/serve -s build -l 5000 +Group=wrolpi +User=wrolpi +WorkingDirectory=/opt/wrolpi/app/ + +[Install] +WantedBy=default.target diff --git a/systemd/wrolpi-api.service b/etc/ubuntu20.04/wrolpi-api.service similarity index 100% rename from systemd/wrolpi-api.service rename to etc/ubuntu20.04/wrolpi-api.service diff --git a/systemd/wrolpi-app.service b/etc/ubuntu20.04/wrolpi-app.service similarity index 100% rename from systemd/wrolpi-app.service rename to etc/ubuntu20.04/wrolpi-app.service diff --git a/systemd/wrolpi.target b/etc/ubuntu20.04/wrolpi.target similarity index 100% rename from systemd/wrolpi.target rename to etc/ubuntu20.04/wrolpi.target diff --git a/scripts/install_debian_11.sh b/scripts/install_debian_11.sh index 13b79d84..6befdbb6 100755 --- a/scripts/install_debian_11.sh +++ b/scripts/install_debian_11.sh @@ -52,9 +52,8 @@ visudo -c -f /etc/sudoers.d/90-wrolpi chown wrolpi:wrolpi /media/wrolpi # Install the systemd services -cp /opt/wrolpi/systemd/wrolpi-api.service /etc/systemd/system/ -cp /opt/wrolpi/systemd/wrolpi-app.service /etc/systemd/system/ -sed -i -e 's/^ExecStart=.*/ExecStart=\/usr\/local\/bin\/serve/' /etc/systemd/system/wrolpi-app.service +cp /opt/wrolpi/etc/ubuntu20.04/wrolpi-api.service /etc/systemd/system/ +cp /opt/wrolpi/etc/debian11/wrolpi-app.service /etc/systemd/system/ cp /opt/wrolpi/systemd/wrolpi.target /etc/systemd/system/ /usr/bin/systemctl daemon-reload systemctl enable wrolpi-api.service diff --git a/scripts/install_ubuntu_20.04.sh b/scripts/install_ubuntu_20.04.sh index 43089840..7cea01f7 100755 --- a/scripts/install_ubuntu_20.04.sh +++ b/scripts/install_ubuntu_20.04.sh @@ -56,9 +56,9 @@ visudo -c -f /etc/sudoers.d/90-wrolpi chown wrolpi:wrolpi /media/wrolpi # Install the systemd services -cp /opt/wrolpi/systemd/wrolpi-api.service /etc/systemd/system/ -cp /opt/wrolpi/systemd/wrolpi-app.service /etc/systemd/system/ -cp /opt/wrolpi/systemd/wrolpi.target /etc/systemd/system/ +cp /opt/wrolpi/etc/ubuntu20.04/wrolpi-api.service /etc/systemd/system/ +cp /opt/wrolpi/etc/ubuntu20.04/wrolpi-app.service /etc/systemd/system/ +cp /opt/wrolpi/etc/ubuntu20.04/wrolpi.target /etc/systemd/system/ /usr/bin/systemctl daemon-reload systemctl enable wrolpi-api.service systemctl enable wrolpi-app.service