diff --git a/devops/install_systemd_units.sh b/devops/install_systemd_units.sh index 2c35a3c..53bbd83 100755 --- a/devops/install_systemd_units.sh +++ b/devops/install_systemd_units.sh @@ -5,8 +5,6 @@ cp ./systemd/*.{service,path} /etc/systemd/system/ systemctl daemon-reload systemctl enable deploy-caddy.{path,service} -systemctl enable princetonpy-cron.service -systemctl enable princetonpy-web.service +systemctl enable princetonpy.service systemctl start deploy-caddy.{path,service} -systemctl start princetonpy-cron.service -systemctl start princetonpy-web.service +systemctl start princetonpy.service diff --git a/devops/systemd/princetonpy-cron.service b/devops/systemd/princetonpy-cron.service deleted file mode 100644 index b1e80aa..0000000 --- a/devops/systemd/princetonpy-cron.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=PrincetonPy cron service -After=docker.service -Requires=docker.service - -[Service] -TimeoutStartSec=120 -Restart=always -ExecStart=/usr/bin/docker compose \ - -f /home/princeton/deployed/docker-compose.prod.yml \ - up cron -ExecStop=/usr/bin/docker compose \ - -f /home/princeton/deployed/docker-compose.prod.yml \ - down cron - -[Install] -WantedBy=default.target \ No newline at end of file diff --git a/devops/systemd/princetonpy-web.service b/devops/systemd/princetonpy.service similarity index 80% rename from devops/systemd/princetonpy-web.service rename to devops/systemd/princetonpy.service index 328d2f1..00d99c9 100644 --- a/devops/systemd/princetonpy-web.service +++ b/devops/systemd/princetonpy.service @@ -1,17 +1,17 @@ [Unit] -Description=PrincetonPy web service +Description=PrincetonPy services After=docker.service Requires=docker.service [Service] TimeoutStartSec=120 -Restart=always +RemainAfterExit=yes ExecStart=/usr/bin/docker compose \ -f /home/princeton/deployed/docker-compose.prod.yml \ - up web + up -d ExecStop=/usr/bin/docker compose \ -f /home/princeton/deployed/docker-compose.prod.yml \ - down web + down -d [Install] WantedBy=default.target \ No newline at end of file diff --git a/devops/uninstall_systemd_units.sh b/devops/uninstall_systemd_units.sh index 36f394f..be41bb6 100755 --- a/devops/uninstall_systemd_units.sh +++ b/devops/uninstall_systemd_units.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash systemctl disable deploy-caddy.{path,service} -systemctl disable princetonpy-cron.service -systemctl disable princetonpy-web.service +systemctl disable princetonpy.service systemctl daemon-reload # rm ./systemd/deploy-caddy.{path,service} \ No newline at end of file