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/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239692

            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=teststartcmd
load_rc_config $name
start_cmd="teststartcmd_start"
teststartcmd_start() {
        env
}
run_rc_command "$1"
```

2. Run `sysrc teststartcmd_env="TESTVARIABLE=foo"` 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=testcommand
load_rc_config $name
command="/usr/bin/env"
run_rc_command "$1"
```

5. Run `sysrc testcommand_env="TESTVARIABLE=foo"` to modify rc.conf.

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

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

help

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