0

I have a linux program that will always run as a single instance given a .conf file listening on a specific port. there's nothing wrong with assigning a totally new and unrelated port but the program will find a way to kill the old one.

is there a way to trick the program into running as different instance on linux using different CPU cores?

  • I have tried to rename the program but it doesn't work. it will always kill the original running program even when assigned a different listening port. – samwongdotcom Sep 24 '14 at 15:49
  • 3
    Show us your code, describe what it does instead of working, and perhaps we can help. – ghoti Sep 24 '14 at 15:51
  • 1
    What I have done to do some tricks like this is to scan /proc for the programs name, in order to see, if some instance of it is already running. But this is only a tweak, because I also did not find out, how the proper way is. I would be interested, too. But i found this: http://stackoverflow.com/questions/220525/ensuring-a-single-instance-of-an-application-in-linux, so possible duplicate of it. – icbytes Sep 24 '14 at 16:10

1 Answers1

0

Try running the second instance in a chroot. its possibly using a pid file in /var or /tmp or its own directory. create a jail location and copy or bind mount all the bin and etc files.

suppandi g
  • 504
  • 1
  • 5
  • 18