diff --git a/dt-cart/dt-cart.service b/dt-cart/dt-cart.service new file mode 100644 index 0000000..f2c33e4 --- /dev/null +++ b/dt-cart/dt-cart.service @@ -0,0 +1,16 @@ +[Unit] +Description=Classification and Regression Trees (CART) Service + +[Service] +Type=forking +WorkingDirectory=/opt/dt-cart +ExecStart=/opt/dt-cart/service.run +ExecStop=/bin/kill -TERM $MAINPID +Restart=on-abnormal +TimeoutSec=900 + +User=athene +Group=athene + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/dt-cart/run_service.sh b/dt-cart/gunicorn.sh similarity index 100% rename from dt-cart/run_service.sh rename to dt-cart/gunicorn.sh diff --git a/dt-cart/service.run b/dt-cart/service.run new file mode 100644 index 0000000..42350da --- /dev/null +++ b/dt-cart/service.run @@ -0,0 +1,2 @@ +#!/bin/sh +poetry run service.run > /var/log/athene/dt-cart-$(date +%Y-%m-%d-%H-%M-%S).log & \ No newline at end of file