commit:     d980798d6444bbfc508796a233e962bf4dd61275
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Tue May 15 00:08:19 2018 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue May 15 00:08:19 2018 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=d980798d

openrc-run: respect the IN_DRYRUN environment variable

This allows rc-service to pass the tryrun option to openrc-run.

This is for #225.

 src/rc/openrc-run.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/rc/openrc-run.c b/src/rc/openrc-run.c
index 73def8fb..ac682c4c 100644
--- a/src/rc/openrc-run.c
+++ b/src/rc/openrc-run.c
@@ -1282,6 +1282,8 @@ int main(int argc, char **argv)
                unsetenv("IN_BACKGROUND");
        }
 
+       if (rc_yesno(getenv("IN_DRYRUN")))
+       dry_run = true;
        if (rc_yesno(getenv("IN_HOTPLUG"))) {
                if (!service_plugable())
                        eerrorx("%s: not allowed to be hotplugged", applet);

Reply via email to