Answer the question
In order to leave comments, you need to log in
How to add a program running in the background to startup?
You need to reread the squid config every second or faster.
Made a service like this, did systemctl daemon-reload && systemctl start my.service and but it doesn't work:
Process: 25961 ExecStart=/usr/bin/watch -n 1 squid -k reconfigure (code=exited, status=1/FAILURE)
Main PID: 25961 (code=exited, status=1/FAILURE)
systemd[1]: Started reread proxy config every 1 seconds.
watch[25961]: Error opening terminal: unknown.
systemd[1]: мой.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: мой.service: Failed with result 'exit-code'.
[Unit]
Description=reread proxy config every 1 seconds
After=syslog.target
After=nginx.service
[Service]
#User=root
ExecStart=/usr/bin/watch -n 1 squid -k reconfigure
#Type=forking
#Restart=always
[Install]
WantedBy=multi-user.target
Answer the question
In order to leave comments, you need to log in
Need to reread squid config every second or faster
As already said, most likely you can avoid the need to do a reload every second.
But if you still want to do this, then you need to use systemd timer, not service: https://opensource.com/article/20/7/systemd-timers
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question