Environment Variables passed to init?
Rob Ubuntu Linux
rob.ubuntu.linux at googlemail.com
Tue Oct 30 16:00:25 GMT 2007
On 10/30/07, Rob Ubuntu Linux <rob.ubuntu.linux at googlemail.com> wrote:
> On 10/30/07, Scott James Remnant <scott at netsplit.com> wrote:
> > On Tue, 2007-10-30 at 13:37 +0100, Wolf Paul wrote:
> Write a script to chain load init(8) on boot, with same params and environment :
Actually it's even simpler than that thanks to /proc/cmdline.
cat /proc/cmdline
splash=silent root=UUID=800f74e7-e7b0-4c05-8cb0-f3ea7ce980ae ro quiet
splash LOCATION=HOME
So you can simply use a filter like sed(1), awk(1), or perl(1) to set it.
rob at elm:~$ [ -f /proc/cmdline ] && export LOCATION=`cat /proc/cmdline
| sed -e 's/.*LOCATION=//' -e 's/ .*//'`
rob at elm:~$ printenv LOCATION
HOME
So ignore my previous suggestion.
More information about the upstart-devel
mailing list