From 7f2fabb9aa4a749cd984f5584100ef8c46ffcbb8 Mon Sep 17 00:00:00 2001 From: Bobby Date: Fri, 19 Sep 2025 03:36:15 +0530 Subject: add supporting scripts and services --- systemd/celery.service | 18 ++++++++++++++++++ systemd/celerybeat.service | 15 +++++++++++++++ systemd/daphne.service | 17 +++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 systemd/celery.service create mode 100644 systemd/celerybeat.service create mode 100644 systemd/daphne.service (limited to 'systemd') 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 -- cgit v1.2.3