Re: FreeBSD bootup service start issues

Luca Cazzaniga <[email protected]> Tue, 28 Apr 2026 00:25:32 +0200
Newsgroups gmane.comp.monitoring.monit.general
Message-ID <CAPz4CsyP6Gkd4cx8FS67EoUkgVoxtByMNVzDb_=bmh0qAjTPcA@mail.gmail.com>
--0000000000007f766d0650789832
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Try to use the directive
set onreboot norestart
As described here
https://mmonit.com/monit/documentation/monit.html#SYSTEM-REBOOT-AND-SERVICE=
-STARTUP

Ensure in the os runlevel that monit starts after the services if the
relative checks have active actions like start or exec.. or use the delay
of monit as explained here
https://mmonit.com/monit/documentation/monit.html#DAEMON-MODE

On Mon, Apr 27, 2026, 21:59 Marco Moock <[email protected]> wrote:

> Hello!
>
> I am running monit from pkg ports on FreeBSD 15.
>
> I've set up various services for monitoring.
>
> check process ntpd with pidfile /var/db/ntp/ntpd.pid
>          start program=3D "/usr/sbin/service ntpd start"
>          stop program=3D "/usr/sbin/service ntpd stop"
>          if 3 restarts within 5 cycles then unmonitor
>
> check process sendmail with pidfile /var/run/sendmail.pid
>          start program =3D "/usr/sbin/service sendmail start"
>          stop program =3D "/usr/sbin/service sendmail stop"
>          if 3 restarts within 5 cycles then unmonitor
>
> check process named with pidfile /var/run/named/pid
>          start program =3D "/usr/sbin/service named start"
>          stop program =3D "/usr/sbin/service named stop"
>          if 3 restarts within 5 cycles then unmonitor
>
> I've also enabled those services in rc.conf, so the rc scripts will
> start them up
>
> When the OS boots up, monit notices that they are not running and tries
> to start them.
>
> This causes issues with ntpd and sendmail.
>
> What is the proper way to handle this?
>
>
> --
> Gru=C3=9F
> Marco
> Muell und Spam bitte an [email protected]
>
>

--0000000000007f766d0650789832
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div dir=3D"auto">Hi Try to use the directive</div><div d=
ir=3D"auto">set onreboot norestart</div><div dir=3D"auto">As described here=
</div><a href=3D"https://mmonit.com/monit/documentation/monit.html#SYSTEM-R=
EBOOT-AND-SERVICE-STARTUP">https://mmonit.com/monit/documentation/monit.htm=
l#SYSTEM-REBOOT-AND-SERVICE-STARTUP</a><div dir=3D"auto"><br></div><div dir=
=3D"auto">Ensure in the os runlevel that monit starts after the services if=
 the relative checks have active actions like start or exec.. or use the de=
lay of monit as explained here</div><div dir=3D"auto"><a href=3D"https://mm=
onit.com/monit/documentation/monit.html#DAEMON-MODE">https://mmonit.com/mon=
it/documentation/monit.html#DAEMON-MODE</a></div></div><br><div class=3D"gm=
ail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On M=
on, Apr 27, 2026, 21:59 Marco Moock &lt;<a href=3D"mailto:[email protected]">mm=
@dorfdsl.de</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<b=
r>
<br>
I am running monit from pkg ports on FreeBSD 15.<br>
<br>
I&#39;ve set up various services for monitoring.<br>
<br>
check process ntpd with pidfile /var/db/ntp/ntpd.pid<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0start program=3D &quot;/usr/sbin/service =
ntpd start&quot;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stop program=3D &quot;/usr/sbin/service n=
tpd stop&quot;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if 3 restarts within 5 cycles then unmoni=
tor<br>
<br>
check process sendmail with pidfile /var/run/sendmail.pid<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0start program =3D &quot;/usr/sbin/service=
 sendmail start&quot;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stop program =3D &quot;/usr/sbin/service =
sendmail stop&quot;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if 3 restarts within 5 cycles then unmoni=
tor<br>
<br>
check process named with pidfile /var/run/named/pid<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0start program =3D &quot;/usr/sbin/service=
 named start&quot;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stop program =3D &quot;/usr/sbin/service =
named stop&quot;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if 3 restarts within 5 cycles then unmoni=
tor<br>
<br>
I&#39;ve also enabled those services in rc.conf, so the rc scripts will <br=
>
start them up<br>
<br>
When the OS boots up, monit notices that they are not running and tries <br=
>
to start them.<br>
<br>
This causes issues with ntpd and sendmail.<br>
<br>
What is the proper way to handle this?<br>
<br>
<br>
-- <br>
Gru=C3=9F<br>
Marco<br>
Muell und Spam bitte an <a href=3D"mailto:[email protected]=
sl.de" target=3D"_blank" rel=3D"noreferrer">[email protected]=
fdsl.de</a><br>
<br>
</blockquote></div>

--0000000000007f766d0650789832--