Add support for custom user scripts
Description
(Primarily) in debugging situations, there are times when you want to install some script to be run on every boot.
Typical scenarios:
- A hardware engineer want some component to be automatically placed in a test mode
- We want to start a custom data collector to help debug a transient issue
Up to this point, this has been solved by building custom images, but it would be great if this could be added to production images as well.
Additional Information
IMPORTANT: We do not want any code to execute that can't be traced back to the startup-config. This was the primary shortcoming of #461, which led to this proposal.
Example usage:
No scripts are executed unless the service is enabled:
admin@infix-00-00-00:/> configure
admin@infix-00-00-00:/config/> edit rc.d
admin@infix-00-00-00:/config/rc.d/> set enabled
We then have a list of scripts that can be interactively edited, like container content mounts:
admin@infix-00-00-00:/config/rc.d/> text-editor script my-script content
... interactive editor starts up ...
These
rc.dscripts would be run at the same point as/etc/rc.localon systems with Finit.
General Information
Anyone can help out by sponsoring development of new features or contributing pull requests. Please use this issue for discussions related to the feature.
CCB thinks most of this might already be covered by containers. But possibly interesting on builds without containers and for scripts that need to run very early.
Update: We should consider generalizing this so that users can inject files at any path. Then a user can drop in extra config snippets to deamons with daemon.d/ support. E.g., to enable FRR debugging, enable some dnsmasq option, or similar.