Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Aug 2019 12:12:40 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 239692] rc: Environment variables set via ${name}_env are not passed to ${rc_arg}_cmd (e.g., start_cmd)
Message-ID:  <bug-239692-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D239692

            Bug ID: 239692
           Summary: rc: Environment variables set via ${name}_env are not
                    passed to ${rc_arg}_cmd (e.g., start_cmd)
           Product: Base System
           Version: 11.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: 0mp@FreeBSD.org

Here are the steps to reproduce:

1. Save the following script as /usr/local/etc/rc.d/teststartcmd and make it
executable:

```
#!/bin/sh
# PROVIDE: teststartcmd
. /etc/rc.subr
name=3Dteststartcmd
load_rc_config $name
start_cmd=3D"teststartcmd_start"
teststartcmd_start() {
        env
}
run_rc_command "$1"
```

2. Run `sysrc teststartcmd_env=3D"TESTVARIABLE=3Dfoo"` to modify rc.conf.

3. Run `service teststartcmd onestart` and observe that TESTVARIABLE is not=
 in
the output.

4. Save the following script as /usr/local/etc/rc.d/testcommand and make it
executable:

```
#!/bin/sh
# PROVIDE: testcommand
. /etc/rc.subr
name=3Dtestcommand
load_rc_config $name
command=3D"/usr/bin/env"
run_rc_command "$1"
```

5. Run `sysrc testcommand_env=3D"TESTVARIABLE=3Dfoo"` to modify rc.conf.

6. Run `service testcommand onestart` and observe that TESTVARIABLE is in t=
he
output this time.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-239692-227>