Skip to content

RFE: Custom service actions/commands #3656

@gdamjan

Description

@gdamjan

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions