aboutsummaryrefslogtreecommitdiff
path: root/systemd
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-09-19 03:36:15 +0530
committerBobby <[email protected]>2025-09-19 03:36:15 +0530
commit7f2fabb9aa4a749cd984f5584100ef8c46ffcbb8 (patch)
tree49cf0194d986cc9009fd2624cfa74c577ec07d9a /systemd
parent539baacd7b88e7d807e9f6f5660352a18d618c8b (diff)
downloadthatcomputerscientist-7f2fabb9aa4a749cd984f5584100ef8c46ffcbb8.tar.xz
thatcomputerscientist-7f2fabb9aa4a749cd984f5584100ef8c46ffcbb8.zip
add supporting scripts and services
Diffstat (limited to 'systemd')
-rw-r--r--systemd/celery.service18
-rw-r--r--systemd/celerybeat.service15
-rw-r--r--systemd/daphne.service17
3 files changed, 50 insertions, 0 deletions
diff --git a/systemd/celery.service b/systemd/celery.service
new file mode 100644
index 00000000..0e9d72b6
--- /dev/null
+++ b/systemd/celery.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=Celery Service
+After=network.target
+
+[Service]
+Type=forking
+User=ubuntu
+Group=ubuntu
+EnvironmentFile=/home/ubuntu/thatcomputerscientist/.env
+WorkingDirectory=/home/ubuntu/thatcomputerscientist
+ExecStart=/home/ubuntu/thatcomputerscientist/venv/bin/celery -A thatcomputerscientist worker --detach
+ExecStop=/home/ubuntu/thatcomputerscientist/venv/bin/celery -A thatcomputerscientist control shutdown
+ExecReload=/bin/kill -s HUP $MAINPID
+KillMode=mixed
+Restart=always
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file
diff --git a/systemd/celerybeat.service b/systemd/celerybeat.service
new file mode 100644
index 00000000..3428d3a2
--- /dev/null
+++ b/systemd/celerybeat.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Celery Beat Service
+After=network.target
+
+[Service]
+Type=simple
+User=ubuntu
+Group=ubuntu
+EnvironmentFile=/home/ubuntu/thatcomputerscientist/.env
+WorkingDirectory=/home/ubuntu/thatcomputerscientist
+ExecStart=/home/ubuntu/thatcomputerscientist/venv/bin/celery -A thatcomputerscientist beat
+Restart=always
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file
diff --git a/systemd/daphne.service b/systemd/daphne.service
new file mode 100644
index 00000000..026ed28c
--- /dev/null
+++ b/systemd/daphne.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=That Computer Scientist Daphne Service
+After=network.target
+
+[Service]
+Type=simple
+User=ubuntu
+Restart=always
+RestartSec=5
+KillMode=mixed
+KillSignal=SIGKILL
+TimeoutStopSec=5
+WorkingDirectory=/home/ubuntu/thatcomputerscientist
+ExecStart=/home/ubuntu/thatcomputerscientist/venv/bin/daphne -b 127.0.0.1 -p 8080 --websocket_timeout 600 -t 300 --proxy-headers --ping-interval 10 --ping-timeout 30 thatcomputerscientist.asgi:application
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file