cmm: add configd action for interface reassignment restart

Add actions_cmm.conf so OPNsense configd can restart CMM when
interfaces are reassigned. Include in package build and plist.
This commit is contained in:
Tomaz Zaman 2026-04-03 16:54:36 +02:00
parent a25df123fa
commit b728bd41f7
3 changed files with 7 additions and 0 deletions

View file

@ -254,6 +254,8 @@ package: all
# OPNsense plugin files (hwmon dashboard widget)
cp -R ${OPSDIR}/plugins/hwmon/src/opnsense/ ${PKG_STAGEDIR}/usr/local/opnsense/
chmod 755 ${PKG_STAGEDIR}/usr/local/opnsense/scripts/hwmon/sensors.py
# CMM configd action (restart on interface reassignment)
install -m 644 ${PKG_CONFDIR}/actions_cmm.conf ${PKG_STAGEDIR}/usr/local/opnsense/service/conf/actions.d/
# Generate manifest with version
sed 's/%%VERSION%%/${PKG_VERSION}/' ${PKG_METADIR}/+MANIFEST \
> ${PKG_STAGEDIR}/+MANIFEST

4
config/actions_cmm.conf Normal file
View file

@ -0,0 +1,4 @@
[restart]
command:/usr/local/etc/rc.d/cmm restart
type:script
message:Restarting CMM after interface change

View file

@ -28,6 +28,7 @@
@dir /usr/local/opnsense/scripts/hwmon
/usr/local/opnsense/scripts/hwmon/sensors.py
/usr/local/opnsense/service/conf/actions.d/actions_hwmon.conf
/usr/local/opnsense/service/conf/actions.d/actions_cmm.conf
/usr/local/opnsense/mvc/app/controllers/OPNsense/Hwmon/Api/SensorsController.php
/usr/local/opnsense/mvc/app/models/OPNsense/Hwmon/ACL/ACL.xml
/usr/local/opnsense/www/js/widgets/Hwmon.js