+* [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris
* Start using 'design by contract' assertions.
* Allow null driftfile.
* leap second infrastructure fixes from Dave Mills.
LIBS="$LIBS -lcap"
;;
esac
-
+AC_CHECK_HEADERS(libscf.h)
+case "$ac_cv_header_libscf_h" in
+ yes)
+ AC_SUBST(LSCF, [-lscf])
+ ;;
+esac
+AC_CHECK_FUNC(setppriv,AC_DEFINE(HAVE_SOLARIS_PRIVS, ,[Are Solaris privileges available?]), )
case "$build" in
$host)
;;
# sqrt ntp_control.o
# floor refclock_wwv.o
# which are (usually) provided by -lm.
-ntpd_LDADD = $(LDADD) -lm @LCRYPTO@ $(LIBOPTS_LDADD) ../libntp/libntp.a
-ntpdsim_LDADD = $(LDADD) -lm @LCRYPTO@ $(LIBOPTS_LDADD) ../libntp/libntpsim.a
+ntpd_LDADD = $(LDADD) -lm @LCRYPTO@ @LSCF@ $(LIBOPTS_LDADD) ../libntp/libntp.a
+ntpdsim_LDADD = $(LDADD) -lm @LCRYPTO@ @LSCF@ $(LIBOPTS_LDADD) ../libntp/libntpsim.a
ntpdsim_CFLAGS = $(CFLAGS) -DSIM
check_y2k_LDADD = $(LDADD) ../libntp/libntp.a
DISTCLEANFILES = .version version.c
#include "ntp_string.h"
#include <stdio.h>
+#ifdef HAVE_LIBSCF_H
+#include <libscf.h>
+#endif
#if defined(VMS) && defined(VMS_LOCALUNIT) /*wjm*/
#include "ntp_refclock.h"
u_char ostratum;
double dtemp;
l_fp now;
+#ifdef HAVE_LIBSCF_H
+ char *fmri;
+#endif
/*
* There must be a system peer at this point. If we just changed
*/
case -1:
report_event(EVNT_SYSFAULT, NULL);
+#ifdef HAVE_LIBSCF_H
+ /* enter the maintenance mode */
+ if ((fmri = getenv("SMF_FMRI")) != NULL) {
+ if (smf_maintain_instance(fmri, 0) < 0) {
+ printf("smf_maintain_instance:%s\n",
+ scf_strerror(scf_error()));
+ exit(1);
+ }
+ /* sleep until SMF kills us */
+ for (;;)
+ pause();
+ }
+#endif
exit (-1);
/* not reached */