]> git.puffer.fish Git - mirror/frr.git/commit
lib: Ensure FRR detects running of the second instance of a FRR daemon, doesnot allow... 2983/head
authorBiswajit Sadhu <sadhub@vmware.com>
Thu, 6 Sep 2018 09:51:40 +0000 (02:51 -0700)
committerBiswajit Sadhu <sadhub@vmware.com>
Thu, 6 Sep 2018 09:51:40 +0000 (02:51 -0700)
commit6e23e5e9e16fb16aafb4ef05ceb3514a02147a21
tree7c38b58a1da5aaff453599d55d05747cb3199437
parent3bf513a5975848bc9ff9dbc5529d8c43a88b8d60
lib: Ensure FRR detects running of the second instance of a FRR daemon, doesnot allow it to run.

Solution :
The following procedures would be performed :

1. Verify if the pid file for each daemon is present or not. If the file is not present, that means the
   daemon is getting instantiated for the first time. So let it go ahead.
   If the file is present proceed to point ‘2’.

2. Try fetching the properties of the pid file.

3. If it has RW lock, that means one instance of this the daemon is already running.
   So stop moving ahead and do exit() else let it go ahead.
Please note all above procedure happen at
   the initial state of daemon’s instantiation, much before it starts any session with other
   process/allocates resources etc.. and this verification do not have any impact of any
   operations done later, if the verification succeeds.

Signed-off-by: bisdhdh sadhub@vmware.com
lib/libfrr.c