cleanup socket fixes #1210

This commit is contained in:
wh1te909 2022-10-07 17:15:37 +00:00
parent 93a5dd5de4
commit 65ab14e68b
2 changed files with 34 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
SCRIPT_VERSION="68"
SCRIPT_VERSION="69"
SCRIPT_URL='https://raw.githubusercontent.com/amidaware/tacticalrmm/master/install.sh'
sudo apt install -y curl wget dirmngr gnupg lsb-release
@ -482,7 +482,7 @@ echo "${rmmservice}" | sudo tee /etc/systemd/system/rmm.service > /dev/null
daphneservice="$(cat << EOF
[Unit]
Description=django channels daemon
Description=django channels daemon v2
After=network.target
[Service]
@ -491,6 +491,8 @@ Group=www-data
WorkingDirectory=/rmm/api/tacticalrmm
Environment="PATH=/rmm/api/env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
ExecStart=/rmm/api/env/bin/daphne -u /rmm/daphne.sock tacticalrmm.asgi:application
ExecStartPre=rm -f /rmm/daphne.sock
ExecStartPre=rm -f /rmm/daphne.sock.lock
Restart=always
RestartSec=3s

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
SCRIPT_VERSION="139"
SCRIPT_VERSION="140"
SCRIPT_URL='https://raw.githubusercontent.com/amidaware/tacticalrmm/master/update.sh'
LATEST_SETTINGS_URL='https://raw.githubusercontent.com/amidaware/tacticalrmm/master/api/tacticalrmm/tacticalrmm/settings.py'
YELLOW='\033[1;33m'
@ -127,6 +127,35 @@ printf >&2 "${GREEN}Stopping ${i} service...${NC}\n"
sudo systemctl stop ${i}
done
CHECK_DAPHNE=$(grep v2 /etc/systemd/system/daphne.service)
if ! [[ $CHECK_DAPHNE ]]; then
sudo rm -f /etc/systemd/system/daphne.service
daphneservice="$(cat << EOF
[Unit]
Description=django channels daemon v2
After=network.target
[Service]
User=${USER}
Group=www-data
WorkingDirectory=/rmm/api/tacticalrmm
Environment="PATH=/rmm/api/env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
ExecStart=/rmm/api/env/bin/daphne -u /rmm/daphne.sock tacticalrmm.asgi:application
ExecStartPre=rm -f /rmm/daphne.sock
ExecStartPre=rm -f /rmm/daphne.sock.lock
Restart=always
RestartSec=3s
[Install]
WantedBy=multi-user.target
EOF
)"
echo "${daphneservice}" | sudo tee /etc/systemd/system/daphne.service > /dev/null
sudo systemctl daemon-reload
fi
rm -f /rmm/api/tacticalrmm/app.ini
uwsgini="$(cat << EOF