From cc989c4aa9a19438c8805e164a9c6dc811a886a8 Mon Sep 17 00:00:00 2001 From: Bryan Gerlach Date: Wed, 6 Nov 2024 16:00:14 -0600 Subject: [PATCH] added systemd instructions --- setup.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/setup.md b/setup.md index d239e12..8cc8333 100644 --- a/setup.md +++ b/setup.md @@ -81,3 +81,37 @@
  • If you change your repository name, make sure to change the url on lines 161-168 of views.py to reflect the change
  • If you are running on http instead of https, make sure to make the change on line 70 of views.py
  • + +## To autostart the server on boot, you can set up a systemd service called rdgen.service + +replace user, group, and port if you need to +replace /opt with wherever you have installed rdgen +save the following file as /etc/systed/system/rdgen.service +``` +[Unit] +Description=Rustdesk Client Generator +[Service] +Type=simple +LimitNOFILE=1000000 +ExecStart=/usr/bin/python3 /opt/rdgen/manage.py runserver 0.0.0.0:8000 +WorkingDirectory=/opt/rdgen/ +User=root +Group=root +Restart=always +StandardOutput=file:/var/log/rdgen.log +StandardError=file:/var/log/rdgen.error +# Restart service after 10 seconds if node service crashes +RestartSec=10 +[Install] +WantedBy=multi-user.target +``` + +then run this to enable autostarting the service on boot, and then start it manually this time: +``` +sudo systemctl enable rdgen.service +sudo systemctl start rdgen.service +``` +and to get the status of the server, run: +``` +sudo systemctl status rdgen.service +``` \ No newline at end of file