Conversation
Add a new service that, when enabled, will execute run-parts on `/cfg/user-scripts.d`. This strikes a balance between two conflicting objectives: 1. There should be no implicit way to schedule arbitrary code execution on the device, i.e. no default run-parts directory. 2. It is very useful to have a way of scheduling arbitrary code execution on the device, e.g. being able to install a debug script on a production image. With this feature, we still meet (1), since the feature has to be explicitly enabled in the startup-config; but we also fulfill (2), since we can easily enable it when needed.
Verify that: - Scripts are executed when the service is enabled - Scripts are not enabled when the service is disabled
troglobit
left a comment
There was a problem hiding this comment.
Other than my proposed change, I see no problem with this.
I like the warning, it should make it clear to anyone the risks involved with this.
| - Add support for optionally running user scripts from | ||
| `/cfg/user-scripts.d` |
There was a problem hiding this comment.
I liked the old name better, /cfg/start.d was short and sweet and also illustrative of when the scripts run (at startup-up).
Propose changing to that.
There was a problem hiding this comment.
Yeah I agree. I was trying to find a common name that would work both for the directory name and the service name.
Should we also change the name of the service in that case? Suggestions?
There was a problem hiding this comment.
Hmm, good question. Maybe just plain start scripts?
Considering the Finit runparts supports SXXfoo and KXXbar style notation (appends start and stop to the script), maybe we want to add support for stop scripts later, i.e., scripts that run at shutdown/reboot?
|
After AFK discussion, we agree that we prefer to have the actual script content in the config as well. Further discussions should happen in #463. |
Description
Add a new service that, when enabled, will execute
run-partson/cfg/user-scripts.d.This strikes a balance between two conflicting objectives:
With this feature, we still meet 1️⃣, since the feature has to be explicitly enabled in the startup-config; but we also fulfill 2️⃣, since we can easily enable it when needed.
Other information
Checklist
Tick relevant boxes, this PR is-a or has-a: