Skip to content

Supervisor scripts modify the global variable extra_commands, even if the supervisor is not used. #959

@linsein

Description

@linsein

Environment

alpine linux 3.24.0_alpha20251224
openrc 0.63-r1

Reproduction

#!/sbin/openrc-run

name="demo"
command="true"
$ ./demo reload
/usr/libexec/rc/sh/openrc-run.sh: line 224: s6-svc: not found

Analysis

openrc-run.sh.in always imports supervisor scripts:

openrc/sh/openrc-run.sh.in

Lines 261 to 265 in a951b9a

# load service supervisor functions
sourcex "@LIBEXECDIR@/sh/runit.sh"
sourcex "@LIBEXECDIR@/sh/s6.sh"
sourcex "@LIBEXECDIR@/sh/start-stop-daemon.sh"
sourcex "@LIBEXECDIR@/sh/supervise-daemon.sh"

s6.sh changes the default extra_commands:

extra_commands="restart reload ${extra_commands}"

commands defined only for s6 supervisor:

openrc/sh/s6.sh

Lines 225 to 233 in a951b9a

restart() {
_s6_set_variables
s6-svc -r -- "$_service"
}
reload() {
_s6_set_variables
s6-svc -h -- "$_service"
}

also in supervise-daemon.sh:

extra_commands="healthcheck unhealthy ${extra_commands}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions