[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).
diff --git a/zebra/main.c b/zebra/main.c
index 14b0273..2d6a4ac 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -382,6 +382,9 @@
/* 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);