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)
Mon, Dec 16, 6:17 PM
Unknown Object (File)
Tue, Dec 10, 5:00 AM
Unknown Object (File)
Nov 10 2024, 3:24 PM
Unknown Object (File)
Nov 4 2024, 6:16 PM
Unknown Object (File)
Oct 31 2024, 2:30 PM
Unknown Object (File)
Oct 31 2024, 2:29 PM
Unknown Object (File)
Oct 31 2024, 2:29 PM
Unknown Object (File)
Oct 31 2024, 2:11 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.