[Git][NTPsec/ntpsec][master] Address GitLab issue #481 - Give a warning if statsdir doesn't exist

Eric S. Raymond gitlab at mg.gitlab.com
Wed Aug 8 19:27:50 UTC 2018


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
0a2bb57e by Eric S. Raymond at 2018-08-08T19:27:13Z
Address GitLab issue #481 - Give a warning if statsdir doesn't exist

- - - - -


1 changed file:

- ntpd/ntpd.c


Changes:

=====================================
ntpd/ntpd.c
=====================================
@@ -888,7 +888,6 @@ ntpdmain(
 	have_interface_option = (!listen_to_virtual_ips || explicit_interface);
 	readconfig(getconfig(explicit_config));
 	check_minsane();
-
         if ( 8 > sizeof(time_t) ) {
 	    msyslog(LOG_ERR, "INIT: This system has a 32-bit time_t.");
 	    msyslog(LOG_ERR, "INIT: This ntpd will fail on 2038-01-19T03:14:07Z.");
@@ -905,6 +904,10 @@ ntpdmain(
 	}
 #endif
 
+	if (access(statsdir, W_OK) != 0) {
+	    msyslog(LOG_ERR, "statistics directory %s does not exist or is unwriteable, error %s", statsdir, strerror(errno)); 
+	}
+
 	mainloop();
         /* unreachable, mainloop() never returns */
 }



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/0a2bb57e7c0b13c9f54150773b8798102f4b593d

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/0a2bb57e7c0b13c9f54150773b8798102f4b593d
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20180808/5114ca0c/attachment.html>


More information about the vc mailing list