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, May 5, 2:09 PM
Unknown Object (File)
Tue, Apr 30, 4:13 PM
Unknown Object (File)
Thu, Apr 25, 10:19 PM
Unknown Object (File)
Mon, Apr 22, 5:13 PM
Unknown Object (File)
Mar 9 2024, 12:44 PM
Unknown Object (File)
Jan 3 2024, 2:18 AM
Unknown Object (File)
Dec 20 2023, 2:20 AM
Unknown Object (File)
Dec 10 2023, 6:21 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.