Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 545012

Summary: openrc-0.13.11: scripts in /etc/local.d are called with arguments
Product: Gentoo Hosted Projects Reporter: Dirk Sondermann <ds-gentoo>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal CC: ds-gentoo
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 520144    

Description Dirk Sondermann 2015-03-29 23:59:39 UTC
As long as rc_verbose is not set to yes in rc.conf, /etc/init.d/local
calls the scripts in /etc/local.d with the three arguments ">",
"/dev/null" and "2>&1".

This is a consequence of an attempt to fix bug 537444. The lines in
start() and stop() that execute the scripts now read
  "${file}" $redirect
where $redirect is either empty (for rc_verbose=yes) or contains
"> /dev/null 2>&1" (for rc_verbose=no). But, of course, in the latter
case $redirect is not treated as a redirection but its words are
passed as arguments to ${file}.

TEST
Set rc_verbose=no in rc.conf und put the script
  #!/bin/bash
  echo args = $*
in /etc/init.d/local.

RESULT
The content of $redirect is displayed:
  * Starting local ...
  args = > /dev/null 2>&1
Comment 1 William Hubbs gentoo-dev 2015-04-03 02:45:25 UTC
The fix is in this pull request:

https://github.com/OpenRC/openrc/pull/50