Page MenuHomeFreeBSD

rc.subr: Support loading environmental variables from a file
ClosedPublic

Authored by feld on Feb 20 2018, 6:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 3:24 PM
Unknown Object (File)
Mon, Nov 4, 6:16 PM
Unknown Object (File)
Thu, Oct 31, 2:30 PM
Unknown Object (File)
Thu, Oct 31, 2:29 PM
Unknown Object (File)
Thu, Oct 31, 2:29 PM
Unknown Object (File)
Thu, Oct 31, 2:11 PM
Unknown Object (File)
Oct 23 2024, 2:07 AM
Unknown Object (File)
Oct 16 2024, 8:10 PM
Subscribers

Details

Summary

The ${name}_env is not convenient for setting multiple environmental variables
or variables that may have spaces in the value field. Support loading
environment from a file.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

When the env file is missing it breaks the rc script in a fairly obvious way:

.: cannot open /usr/local/etc/fake.env.file.not.there: No such file or directory

This seems fine to me and extra error handling probably isn't necessary unless someone else can think of another issue I'm overlooking.

This revision is now accepted and ready to land.May 15 2018, 5:30 PM
mat added inline comments.
etc/rc.subr
962 ↗(On Diff #39537)
[ -n "$_env_file" ] && [ -r "${_env_file}" ]
feld marked an inline comment as done.May 25 2018, 7:29 PM

Committing with the suggested change by mat.

This revision was automatically updated to reflect the committed changes.