Installing and running multiple instances of the same software

Karl Auer kauer at biplane.com.au
Sun Mar 13 05:51:47 UTC 2016


On Sun, 2016-03-13 at 07:20 +0300, Amer wrote:
> I would like to install the same software twice in my machine. The
> software is vyatta and my machine is Ubuntu 12.04. Also, I want to
> run these two instances at the same time.
> I do not want to use VMs based solution.

There are two main barriers to running the same software twice on the
same system. One is where the software looks for running instances of
itself and refuses to run a second instance (or starts up some form of
subprocess of the original instance instead of a whole new process).
For an example of this, look at firefox:

kauer at kt:~$ ps ax | grep firefox | grep -v grep
 1980 ?        Sl    14:01 /usr/lib/firefox/firefox
kauer at kt:~$ firefox
kauer at kt:~$ ps ax | grep firefox | grep -v grep
 1980 ?        Sl    14:03 /usr/lib/firefox/firefox

... even though I started a "new" firefox, the new window was started
within the existing process; even though a new window opened, there is
still only one firefox process.

Sometimes such programs have command line options to allow you to start
additional instances; check the documentation. For example, Firefox has
the -no-remote option. Two instances can't use the same profile, so to
use -no-remote you have to either specify a non-default profile or use
the -ProfileManager option at the same time. I created a new profile
for this demonstration and have removed the command line tails here for
clarity. As you can see, a second firefox process was started:

kauer at kt:~$ ps ax | grep firefox | grep -v grep
 1980 ?        Sl    14:12 /usr/lib/firefox/firefox
kauer at kt:~$ firefox -no-remote -p testing &
[1] 8662
kauer at kt:~$ ps ax | grep firefox | grep -v grep
 1980 ?        Sl    14:12 /usr/lib/firefox/firefox
 8662 pts/2    Sl     0:01 /usr/lib/firefox/firefox

The other main barrier is where the software uses a unique system
resource, that cannot be used at the same time by another process. An
example of this would be a web server, a DNS server or similar, because
they take over particular ports. I haven't used vyatta, but I strongly
suspect that this is the problem with it, because it will be listening
on particular ports for eg BGP communications.

Sometimes such programs have configuration options that allow them to
use non-standard ports - for example, BIND can be configured to listen
on ports other than port 53, Apache can be configured to listen on
ports other than port 80. However, this is generally only useful for
testing purposes, because the systems attempting to connect to these
services generally expect them to be on the standard ports.

As Ralf has said, if you tell us what exactly you are trying to
achieve, we may be able to help you work out a solution.

Regards, K.


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: E00D 64ED 9C6A 8605 21E0 0ED0 EE64 2BEE CBCB C38B
Old fingerprint: 3C41 82BE A9E7 99A1 B931 5AE7 7638 0147 2C3C 2AC4







More information about the ubuntu-users mailing list