summaryrefslogtreecommitdiffstats
path: root/zebra/main.c
diff options
context:
space:
mode:
authorDenis Ovsienko <pilot@etcnet.org>2009-07-24 18:45:31 +0200
committerDenis Ovsienko <pilot@etcnet.org>2009-07-24 18:45:31 +0200
commit97be79f9d38b07214d5ad9b437e1a852c594a985 (patch)
treedbc8513b7f58c4f603ea1eed87efe9dbf4d7897e /zebra/main.c
parent[doc] zebra.8 via Christian Hammers (#531) (diff)
downloadfrr-97be79f9d38b07214d5ad9b437e1a852c594a985.tar.xz
frr-97be79f9d38b07214d5ad9b437e1a852c594a985.zip
[zebra] do not touch socket before pidfile locking
Move zserv socket creation code into zebra_zserv_socket_init() and call it only after pidfile lock has been acquired exclusively. This keeps subsequent zebra daemons from deleting the working socket of an already running process (bug #403).
Diffstat (limited to 'zebra/main.c')
-rw-r--r--zebra/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/zebra/main.c b/zebra/main.c
index 14b0273cb..2d6a4ac86 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -382,6 +382,9 @@ main (int argc, char **argv)
/* Needed for BSD routing socket. */
pid = getpid ();
+ /* This must be done only after locking pidfile (bug #403). */
+ zebra_zserv_socket_init ();
+
/* Make vty server socket. */
vty_serv_sock (vty_addr, vty_port, ZEBRA_VTYSH_PATH);