N
N
niknik112017-01-15 13:35:16
linux
niknik11, 2017-01-15 13:35:16

How to limit the launch of a program to one instance?

Task: it is necessary to control that the program is always running and only in one instance.
Usually done through a file next to the process number and checking if it is alive, but maybe there are ready-made popular solutions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2017-01-15
@khrisanfov

Usually, the file with the process number is created not next to the executable file, but in /var/run/[process name]/[file].pid. This is a simple classic way and you do not need to invent anything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question