| Summary: | .sh scripts in /usr/local/etc/rc.d get executed, not sourced | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Andre.Albsmeier | ||||
| Component: | conf | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
| Status: | Closed Overcome By Events | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 7.4-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
Responsible Changed From-To: freebsd-bugs->freebsd-rc Over to maintainer(s). For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped |
man rc.subr says: run_rc_script file argument Start the script file with an argument of argument, and handle the return value from the script. Various shell variables are unset before file is started: name, command, command_args, command_interpreter, extra_commands, pidfile, rcvar, required_dirs, required_files, required_vars, argument_cmd, argument_precmd. argument_postcmd. The startup behaviour of file depends upon the following checks: 1. If file ends in .sh, it is sourced into the current shell. 2. If file appears to be a backup or scratch file (e.g., with a suffix of ~, #, .OLD, or .orig), ignore it. 3. If file is not executable, ignore it. 4. If the rc.conf(5) variable rc_fast_and_loose is empty, source file in a sub shell, otherwise source file into the current shell. This is only true for .sh scripts sitting in /etc/rc.d but not for other locations. How-To-Repeat: put test.sh into /usr/local/etc/rc.d and it will get executed in a subshell but not executed in the current shell.