Answer the question
In order to leave comments, you need to log in
Why does a script run by inetd run indefinitely?
Task: when opening a link in a browser on a computer, a script should run. Be sure to use inetd.
I register in /etc/servicesmyscript 1337/tcp
In /etc/inetd.conf
myscript stream tcp nowait root /path/to/script.sh
#!/bin/sh
echo "It's work!" >> test.txt
Answer the question
In order to leave comments, you need to log in
As far as I remember, initd is precisely in order to keep the service as long as there are active connections, then terminate it, but this is not a fact that the service will stop immediately. Depends on OS setting. Accordingly, the script is executed constantly and very many times per second.
I think you need to write a script so that it runs only once and forcibly ends or kills the service process.
For this, the curl utility should be suitable.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question