Quellcode durchsuchen

add squidstats service and update readme

Manuel vor 1 Jahr
Ursprung
Commit
c7a9dca3bc
2 geänderte Dateien mit 34 neuen und 0 gelöschten Zeilen
  1. 19 0
      README.md
  2. 15 0
      utils/squidstats.service

+ 19 - 0
README.md

@@ -164,6 +164,25 @@ nano /etc/crontab
 ```
 3. Save
 
+Or can use service(daemon):
+
+1. Copy file service:
+  ```bash
+    cp ./utils/squidstats.service /etc/systemd/system/squidstats.service
+  ```
+2. Restart daemons:
+  ```bash
+    systemctl daemon-reload
+  ```
+3. Enable service:
+  ```bash
+    systemctl enable squidstats.service
+  ```
+3. Start service:
+  ```bash
+    systemctl start squidstats.service
+  ```
+
 ## Testing Information
 This software has been thoroughly tested and is compatible with Squid version 6.12. Please ensure your Squid installation matches this version or newer for optimal performance.
 

+ 15 - 0
utils/squidstats.service

@@ -0,0 +1,15 @@
+[Unit]
+Description=SquidStats
+After=network.target
+
+[Service]
+Type=simple
+User=root
+WorkingDirectory=/opt/squidstats
+ExecStart=/opt/squidstats/venv/bin/python /opt/squidstats/app.py
+Restart=always
+RestartSec=5
+EnvironmentFile=/opt/squidstats/.env
+
+[Install]
+WantedBy=multi-user.target