-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
RFE: Custom service actions/commands #3656
Copy link
Copy link
Open
Labels
RFE 🎁Request for Enhancement, i.e. a feature requestRequest for Enhancement, i.e. a feature requestneeds-discussion 🤔pid1
Description
Submission type
- Bug report
- Request for enhancement (RFE)
systemd version the issue has been seen with
any
Used distribution
any / Arch
Explanation
systemd unit files can/do keep a lot of state about services, for example: the user/group, capabilities, the working directory, environment variables, possibly also private mounts (private tmp, #3439 etc)…
it would be very usefull to run commands in the same exact environment as the service itself, examples are:
dropdb/initdb/migrate-data/filescan/populatecache and similar.
one approach would be for the .service file to have ExecAction=initdb=command directives that would be invoked with systemctl action initdb a-service.service. Another approach would be extending systemd-run:
with something like systemd-run --inherit=a-service command. (--inherit, --use, --unit or some such).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
RFE 🎁Request for Enhancement, i.e. a feature requestRequest for Enhancement, i.e. a feature requestneeds-discussion 🤔pid1