I seem to remember there was a way to do this in Zeta and Haiku Alpha series. My forum search were not productive in locating good information to do it today.
What is the current preferred method to do to execute shutdown scripts in Haiku B5?
Do we have /shutdown directory like we have a /boot directory for the startup scripts/apps?
The reason is I have start-up bash scripts kicking off on boot-up. I also need to "gracefully’ shutdown the database servers and other processes during shutdown.
Ideally you would put whatever needs to run during the system and then turn off with the system in the aegeis of launch_daemon, it is analogous to what systemd would do on linux for services… sadly adding services is not that userfriendly yet