summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>1999-02-24 15:36:10 +0000
committerTed Lemon <source@isc.org>1999-02-24 15:36:10 +0000
commit5c88755ad14d5dd3148f4e67757fa9276dfa68fb (patch)
tree6850083380e0e300caa753b7b44b60ceef2a5f37
parenta402309275ea647b437b2829cb8f347db6e2dc1b (diff)
downloadisc-dhcp-5c88755ad14d5dd3148f4e67757fa9276dfa68fb.tar.gz
- Fix an obscure case where dhcpd is started by the /etc/rc system
with exactly the same pid each time, dhcpd.pid is not erased on reboot, and therefore dhcpd would detect a server (itself) with the pid in dhcpd.pid and decide that another server was running and exit.
-rw-r--r--server/dhcpd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/dhcpd.c b/server/dhcpd.c
index eea9a3df..921a99ca 100644
--- a/server/dhcpd.c
+++ b/server/dhcpd.c
@@ -42,13 +42,13 @@
#ifndef lint
static char ocopyright[] =
-"$Id: dhcpd.c,v 1.45.2.15 1999/02/23 22:37:50 mellon Exp $ Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.";
+"$Id: dhcpd.c,v 1.45.2.16 1999/02/24 15:36:10 mellon Exp $ Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.";
#endif
static char copyright[] =
"Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.";
static char arr [] = "All rights reserved.";
-static char message [] = "Internet Software Consortium DHCP Server V2.0b1pl15 ";
+static char message [] = "Internet Software Consortium DHCP Server V2.0b1pl16 ";
static char contrib [] = "\nPlease contribute if you find this software useful.";
static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html\n";
@@ -228,7 +228,7 @@ int main (argc, argv, envp)
/* If the previous server process is not still running,
write a new pid file immediately. */
- if (pid && kill (pid, 0) < 0) {
+ if (pid && (pid == getpid () || kill (pid, 0) < 0)) {
unlink (path_dhcpd_pid);
if ((i = open (path_dhcpd_pid,
O_WRONLY | O_CREAT, 0640)) >= 0) {