OPNsense Forum

English Forums => General Discussion => Topic started by: vivekmauli14 on December 10, 2024, 07:38:11 AM

Title: How to register a pkg in menu of services?
Post by: vivekmauli14 on December 10, 2024, 07:38:11 AM
Hi,

I have created a custom FreeBSD package that functions as a regular FreeBSD service. I can start and stop it using the standard FreeBSD service commands (e.g., service <myservice> start).

However, after installing the package, I couldn't find my service listed in the /ui/core/services menu. I'd like to know how to properly register this service so it appears in the services menu and can be controlled via the UI.

After some investigation, I found the /usr/local/etc/inc/<service-name.inc> file, where I added a PHP script similar to how other services like nginx are configured. Despite this, I'm still unable to start, stop, or restart my service from the UI.

Is there a guide or checklist available for this process? Any help or pointers would be greatly appreciated.

Thanks in advance!

Best,
VivekSP
Title: Re: How to register a pkg in menu of services?
Post by: franco on December 10, 2024, 08:47:40 AM
See https://docs.opnsense.org/development/backend/legacy.html#services
Title: Re: How to register a pkg in menu of services?
Post by: _tribal_ on December 10, 2024, 11:17:45 AM
Quote from: vivekmauli14 on December 10, 2024, 07:38:11 AM
Is there a guide or checklist available for this process?

I followed these instructions:
https://blog.ohmykreee.top/article/setup-tun2socks-in-opnsense/

You can also look at files from other services, as an additional example. As strange as it may be, there are some differences in writing even from official doc.