rc.d: use absolute path for python3 in maltrailsensor + maltrailserver (#5466)

service(8) invokes rc.d scripts with PATH=/sbin:/bin:/usr/sbin:/usr/bin
via `env -i`, which does not include /usr/local/bin where python3 lives.
daemon(8)'s execvp("python3") ENOENTs all four PATH entries and the
supervisor exits silently after the pre-detach parent has already
returned 0 to rc.subr. Net result: service start exits 0 with nothing
running, and boot-time autostart is broken when maltrailsensor_enable=YES.

Use absolute path /usr/local/bin/python3 to bypass the PATH lookup,
matching the convention used by other OPNsense plugin rc.d scripts
(stunnel, ddclient, tinc, openconnect).

Validated on OPNsense 26.4 / FreeBSD 14.3-RELEASE-p12 across
3 start/stop cycles + truss re-trace + full cold-start reboot.

Co-authored-by: Tom Reid <tokamaktx@users.noreply.github.com>
This commit is contained in:
NullCascade 2026-06-01 09:37:24 +01:00 committed by GitHub
parent cb9a5d6d69
commit 2b98f0702c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -11,7 +11,7 @@ name=maltrailsensor
rcvar=maltrailsensor_enable
pidfile=/var/run/${name}.pid
command=/usr/sbin/daemon
command_args="-f -P /var/run/maltrailsensor.pid python3 /usr/local/share/maltrail/sensor.py"
command_args="-f -P /var/run/maltrailsensor.pid /usr/local/bin/python3 /usr/local/share/maltrail/sensor.py"
load_rc_config opnsense-maltrailsensor

View file

@ -11,7 +11,7 @@ name=maltrailserver
rcvar=maltrailserver_enable
pidfile=/var/run/${name}.pid
command=/usr/sbin/daemon
command_args="-f -P /var/run/maltrailserver.pid python3 /usr/local/share/maltrail/server.py"
command_args="-f -P /var/run/maltrailserver.pid /usr/local/bin/python3 /usr/local/share/maltrail/server.py"
load_rc_config opnsense-maltrailserver