Monit fails to start after updating to 26.7.10

Started by Maurice, November 24, 2026, 02:02:36 PM

Previous topic - Next topic
Just to start the unavoidable thread. Yes, I did read the release notes, so I wasn't caught completely off guard. 😆

<118>[27] /usr/local/etc/monitrc:25: A program with arguments must be quoted -- unexpected argument '-c'
<118>[27] Monit exiting due to parsing errors in the configuration file.
<118>[27] /usr/local/etc/rc.d/monit: WARNING: failed to start monit

Will investigate later and update this thread.

Cheers
Maurice
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).

Quote from: Maurice on November 24, 2026, 02:02:36 PMYes, I did read the release notes, so I wasn't caught completely off guard. 😆
Ha!  At least it was nicely called out ;)
N5105 | 8/250GB | 4xi226-V | Community

Well, someone complained they should be more to the point. *cough*


Cheers,
Franco

November 24, 2026, 02:39:24 PM #3 Last Edit: November 24, 2026, 02:44:56 PM by sopex
My guess is that you have some custom action that uses exec?

Monit now fails on unquoted program arguments....

"
Fixed: Stray text after a program is now a syntax error. Before, the parser silently added it to the program's arguments. For example, a cron specification without the every keyword became an argument of the stop program above it. An unquoted program is still accepted, but only without arguments. A program with arguments must be quoted. Monit now reports "A program with arguments must be quoted" at the line of the argument. This also catches a Monit keyword used as an argument, as in stop program = /etc/init.d/foo stop. An unquoted program now also works in the form start program = /path. Before, this gave a syntax error.
"
potatonetworks.com

November 24, 2026, 04:19:55 PM #4 Last Edit: November 24, 2026, 04:37:31 PM by julsssark
Monit 6.1 started correctly on my system. Plain vanilla Monit install using only the GUI for config.

Likewise, no issues with Monit after patching to 26.7.10.

Quote from: sopex on November 24, 2026, 02:39:24 PMMy guess is that you have some custom action that uses exec?

Spot on. I use the Execute action to run shell commands with arguments. The Path I use looks like this:

/bin/sh -c "command argument1 argument2" repeat every cycle
This used to work, but now a program (here: /bin/sh) with arguments (here: -c "...") must be quoted. But if you enter a Path which starts with anything but a /, the OPNsense UI rejects it ("Should be a valid absolute file path.").

I'll open an issue in opnsense/core.

Cheers
Maurice
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).

Hm, OPNsense doesn't even accept my existing Paths anymore. If I edit an existing Service Test and save it without changing anything, it gets rejected: "Text may not contain spaces or tabs."

So the UI kind of catches this for new tests, but not for existing ones. And it prevents you from running programs with arguments, which seems kind of important.
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).

Yes, there is some hardening around this for some time now. I am sure there is a way to allow this to work.
potatonetworks.com

It doesn't even allow programs without arguments anymore, if you want to add standard Monit options like "repeat every cycle". Any spaces anywhere seem to be verboten now. That's a bit too much hardening for my taste.
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).