OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 20.1 Legacy Series »
  • Add service to diagnostic service list
« previous next »
  • Print
Pages: [1]

Author Topic: Add service to diagnostic service list  (Read 2414 times)

Massimo1993

  • Newbie
  • *
  • Posts: 18
  • Karma: 2
    • View Profile
Add service to diagnostic service list
« on: February 24, 2020, 01:23:43 pm »
Hi, i wanted to know how i can add a service to the diagnostic service list in the frontend.
I've created the rc.d script and the action config file but it won't appear.




action_node-red.conf
Code: [Select]
[start]
command:/usr/local/etc/rc.d/node-red start
parameters:
type:script
message:starting node-red
[restart]
command:/usr/local/etc/rc.d/node-red restart
parameters:
type:script
message:restarting node-red
[stop]
command:/usr/local/etc/rc.d/node-red stop
parameters:
type:script
message:stopping node-red

Logged

fabian

  • Hero Member
  • *****
  • Posts: 2769
  • Karma: 200
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Add service to diagnostic service list
« Reply #1 on: February 24, 2020, 05:32:48 pm »
You need a function like that one to register it:

https://github.com/opnsense/plugins/blob/master/www/nginx/src/etc/inc/plugins.inc.d/nginx.inc#L38
Logged

Massimo1993

  • Newbie
  • *
  • Posts: 18
  • Karma: 2
    • View Profile
Re: Add service to diagnostic service list
« Reply #2 on: February 24, 2020, 07:49:12 pm »
Quote from: fabian on February 24, 2020, 05:32:48 pm
You need a function like that one to register it:

https://github.com/opnsense/plugins/blob/master/www/nginx/src/etc/inc/plugins.inc.d/nginx.inc#L38

Thanks a lot, i've succeded but i can't figure a way of adding the check for $config[node-red][enabled]
i've checked other rc.d files but couldn't find a way of implementing or understanding how it works.
I'm using this rc.d script to handle node-red.
https://gist.github.com/apearson/56a2cd137099dbeaf6683ef99aa43ce0

Could you please tell me how to do it?

EDIT: it appears to be related to "pluginctl -s", but there isn't any nodered service in the list.
« Last Edit: February 24, 2020, 08:30:26 pm by Massimo1993 »
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2769
  • Karma: 200
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Add service to diagnostic service list
« Reply #3 on: February 24, 2020, 08:45:42 pm »
Just return / use true instead. It is not a managed service.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 20.1 Legacy Series »
  • Add service to diagnostic service list
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2