RE: FreeBSD bootup service start issues

Jamie Burchell via This is the general mailing list for monit <[email protected]> Tue, 28 Apr 2026 08:17:13 +0100
Newsgroups gmane.comp.monitoring.monit.general
Message-ID <[email protected]>
--0000000000005324ec0650800513
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi



Out of interest, why would calling =E2=80=9Cservice X start=E2=80=9D twice =
cause an issue?



That said, I have monit configured to pause for 4 minutes at system start
before it starts to monitor and potentially intervene:



set daemon 30 with start delay 240



Kind regards,

*Jamie*



*From:* [email protected]
<[email protected]> *On Behalf Of *Luca
Cazzaniga
*Sent:* 27 April 2026 23:26
*To:* This is the general mailing list for monit <[email protected]>
*Subject:* Re: FreeBSD bootup service start issues



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?


--=20
Gru=C3=9F
Marco
Muell und Spam bitte an [email protected]

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

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3Dutf-8"><meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered m=
edium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:12.0pt;
	font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
span.EmailStyle18
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:11.0pt;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style></head><body lang=3D"EN-GB" link=3D"blue" vlink=3D"purple" style=
=3D"word-wrap:break-word"><div class=3D"WordSection1"><p class=3D"MsoNormal=
"><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-seri=
f">Hi</span></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font=
-family:&quot;Calibri&quot;,sans-serif">=C2=A0</span></p><p class=3D"MsoNor=
mal"><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-s=
erif">Out of interest, why would calling =E2=80=9Cservice X start=E2=80=9D =
twice cause an issue?</span></p><p class=3D"MsoNormal"><span style=3D"font-=
size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">=C2=A0</span></p><p=
 class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Cali=
bri&quot;,sans-serif">That said, I have monit configured to pause for 4 min=
utes at system start before it starts to monitor and potentially intervene:=
</span></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-fami=
ly:&quot;Calibri&quot;,sans-serif">=C2=A0</span></p><p class=3D"MsoNormal">=
<span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"=
>set daemon 30 with start delay 240</span></p><p class=3D"MsoNormal"><span =
style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">=C2=
=A0</span></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-f=
amily:&quot;Calibri&quot;,sans-serif;color:black">Kind regards,<br><br><b>J=
amie</b></span></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;f=
ont-family:&quot;Calibri&quot;,sans-serif">=C2=A0</span></p><div style=3D"b=
order:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p cla=
ss=3D"MsoNormal"><b><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-fam=
ily:&quot;Calibri&quot;,sans-serif">From:</span></b><span lang=3D"EN-US" st=
yle=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> monit-=
general-bounces+jamie=3D<a href=3D"mailto:[email protected]">ib3.uk@nongnu.=
org</a> &lt;monit-general-bounces+jamie=3D<a href=3D"mailto:[email protected]=
rg">[email protected]</a>&gt; <b>On Behalf Of </b>Luca Cazzaniga<br><b>Sent=
:</b> 27 April 2026 23:26<br><b>To:</b> This is the general mailing list fo=
r monit &lt;<a href=3D"mailto:[email protected]">monit-general@nongn=
u.org</a>&gt;<br><b>Subject:</b> Re: FreeBSD bootup service start issues</s=
pan></p></div><p class=3D"MsoNormal">=C2=A0</p><div><div><p class=3D"MsoNor=
mal">Hi Try to use the directive</p></div><div><p class=3D"MsoNormal">set o=
nreboot norestart</p></div><div><p class=3D"MsoNormal">As described here</p=
></div><p class=3D"MsoNormal"><a href=3D"https://mmonit.com/monit/documenta=
tion/monit.html#SYSTEM-REBOOT-AND-SERVICE-STARTUP">https://mmonit.com/monit=
/documentation/monit.html#SYSTEM-REBOOT-AND-SERVICE-STARTUP</a></p><div><p =
class=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal">Ensure in t=
he 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 expla=
ined here</p></div><div><p class=3D"MsoNormal"><a href=3D"https://mmonit.co=
m/monit/documentation/monit.html#DAEMON-MODE">https://mmonit.com/monit/docu=
mentation/monit.html#DAEMON-MODE</a></p></div></div><p class=3D"MsoNormal">=
=C2=A0</p><div><div><p class=3D"MsoNormal">On Mon, Apr 27, 2026, 21:59 Marc=
o Moock &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:</=
p></div><blockquote style=3D"border:none;border-left:solid #cccccc 1.0pt;pa=
dding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><p class=3D"Mso=
Normal" style=3D"margin-bottom:12.0pt">Hello!<br><br>I am running monit fro=
m pkg ports on FreeBSD 15.<br><br>I&#39;ve set up various services for moni=
toring.<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 ntp=
d start&quot;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stop program=3D &quot;/u=
sr/sbin/service ntpd stop&quot;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if 3 r=
estarts within 5 cycles then unmonitor<br><br>check process sendmail with p=
idfile /var/run/sendmail.pid<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0start pro=
gram =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&quo=
t;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if 3 restarts within 5 cycles then =
unmonitor<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 na=
med 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 unmonitor<br><br>I&#39;ve also enabled tho=
se services in rc.conf, so the rc scripts will <br>start them up<br><br>Whe=
n 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>M=
uell und Spam bitte an <a href=3D"mailto:[email protected]=
l.de" target=3D"_blank">[email protected]</a></p></blo=
ckquote></div></div></body></html>

--0000000000005324ec0650800513--