OPNsense Forum

Archive => 24.1, 24.4 Legacy Series => Topic started by: primroseN on March 18, 2024, 10:05:37 AM

Title: Rc scripts not in expected directory.
Post by: primroseN on March 18, 2024, 10:05:37 AM
Hello all,

I have a custom package, os-myPackage-devel-0.2.pkg which successfully installs on any fresh machine running OPNsense v24.1. But I have an issue with the rc scripts. They don't appear ship into /usr/local/etc/rc.d/  of the new machine, as expected. I presumed that having them referenced in the conf file under actions.d directory was enough. Was I wrong?

Do i need extra steps during packaging to reference the scripts or something similar?

Thanks for your help.
Title: Re: Rc scripts not in expected directory.
Post by: Monviech (Cedrik) on March 18, 2024, 10:17:16 AM
The /usr/local/etc/rc.d/ file will only be packaged if you include it into the packaging process.

Here is an example of where it has to reside in order to be packaged in when you "make package" in /usr/plugins/devel/yourplugin/

The base directory would be /usr/plugins/devel/yourplugin/src/etc/rc.d/

https://github.com/Monviech/os-caddy-plugin/tree/1.5.0/usr/plugins/devel/caddy/src/etc/rc.d
Title: Re: Rc scripts not in expected directory.
Post by: mimugmail on March 18, 2024, 10:54:33 AM
Yes, there are plenty of plugins out there with manual added rc scripts like maltrail:
https://github.com/opnsense/plugins/tree/master/security/maltrail/src/etc/rc.d
Title: Re: Rc scripts not in expected directory.
Post by: primroseN on March 18, 2024, 11:00:14 AM
Thank you for your help. I didn't know I could manually add it like that. Everything is working as expected now.

Cheers,
- Prim