summaryrefslogtreecommitdiffstats
path: root/sbin/hastd
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2012-01-10 22:41:09 +0000
committerpjd <pjd@FreeBSD.org>2012-01-10 22:41:09 +0000
commite437b2804344d6a888fd3ec90ffbf40a04f32307 (patch)
tree9f9759f9b71db07b502d976ac2da1b38189064b0 /sbin/hastd
parentc5fe5a76f24f997008c868c17e6fe6ed1b2aaf7b (diff)
downloadFreeBSD-src-e437b2804344d6a888fd3ec90ffbf40a04f32307.zip
FreeBSD-src-e437b2804344d6a888fd3ec90ffbf40a04f32307.tar.gz
- Fix a bug where pidfile was removed in SIGHUP when it hasn't changed in
configuration file. - Log the fact that pidfile has changed. MFC after: 3 days
Diffstat (limited to 'sbin/hastd')
-rw-r--r--sbin/hastd/hastd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sbin/hastd/hastd.c b/sbin/hastd/hastd.c
index b4b3c59..945f4dc 100644
--- a/sbin/hastd/hastd.c
+++ b/sbin/hastd/hastd.c
@@ -573,10 +573,14 @@ hastd_reload(void)
/*
* Switch to new pidfile.
*/
- (void)pidfile_remove(pfh);
- pfh = newpfh;
- (void)strlcpy(cfg->hc_pidfile, newcfg->hc_pidfile,
- sizeof(cfg->hc_pidfile));
+ if (newpfh != NULL) {
+ pjdlog_info("Pidfile changed from %s to %s.", cfg->hc_pidfile,
+ newcfg->hc_pidfile);
+ (void)pidfile_remove(pfh);
+ pfh = newpfh;
+ (void)strlcpy(cfg->hc_pidfile, newcfg->hc_pidfile,
+ sizeof(cfg->hc_pidfile));
+ }
/*
* Switch to new listen addresses. Close all that were removed.
*/
OpenPOWER on IntegriCloud