S
S
Sergey Gladilin2014-11-10 11:21:12
Perl
Sergey Gladilin, 2014-11-10 11:21:12

How to catch the status of a running script?

The point is the following. On the Unix server, a perl script hangs in memory, which sometimes does something. There is another sh-script, which, when launched, should understand whether the above perl-script is currently processing something or not, and, depending on the result, perform different actions. The only option that comes to mind is with a file where the perl script writes "1" when starting work, and "0" when stopping. Accordingly, the sh-script looks at the same file at startup and understands whether the perl-script "works" now or not. Or adult uncles solve such issues differently?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2014-11-10
@GavriKos

lock file is a perfectly normal solution. And most importantly - universal for the monitoring script. You can only think not to write 0, but to delete the file. And do not forget to put the whole thing into all sorts of actions and other points of possible completion of the script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question