.\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . .TH "KDB\-ELEKTRIFY\-GETENV" "1" "2015-11-19" "" "" . .SH "NAME" \fBkdb\-elektrify\-getenv\fR \- elektrify the environment of applications . .SH "SYNOPSIS" \fBkdb elektrify\-getenv\fR \fIapplication\fR \fIoptions\fR . .SH "DESCRIPTION" When an application is elektrified using libelektragetenv, it does not only request \fBenviron\fR, but also Elektra for every getenv(3) and secure_getenv(3) library call\. . .P Its main purpose is to: . .IP "\(bu" 4 have standard ways to modify the environment . .IP "\(bu" 4 make relogin (or even restart!) of applications unnecessary . .IP "\(bu" 4 allow a hierarchical structure for environment . .IP "\(bu" 4 allow settings to only apply for individual applications or only in special context . .IP "\(bu" 4 still preserve the advantages (inheriting of environment to subprocesses) . .IP "\(bu" 4 Availability in at, cron and similar scripts\. . .IP "" 0 . .P It is implemented using a LD_PRELOAD technique, see \fIUSAGE\fR below for global activation\. . .SH "LOOKUPS" The main purpose of this approach is to finally have a well\-defined way to set and get environment variables\. Elektra\'s variables will be in use immediately for every newly started application (no relogin necessary)\. . .P To do so, getenv(3) will lookup multiple sources next to searching in the environment (environ)\. As running example will use \fBgetenv("HOME") \-> /path/to/home\fR: . .IP "1." 4 Given commandline parameters will always be preferred (see \fIOPTIONS\fR below)\. . .IP E\.g\. \fBkdb elektrify\-getenv \-\-elektra:HOME=/path/to/home\fR . .IP "2." 4 Then \fB/env/override/\fR will be looked up, where \fIkey\fR is the parameter to \fBgetenv\fR\. If found, the key will be returned, if it is a null keys, \fBgetenv\fR will return \fBNULL\fR\. . .IP E\.g\. \fBkdb set user/env/override/HOME /path/to/home\fR . .IP "3." 4 Then environment will be requested\. . .IP E\.g\. \fBHOME=/path/to/home kdb elektrify\-getenv \fR . .IP "4." 4 Then \fB/env/fallback/\fR will be looked up\. If found, the key will be returned, if it is a null keys, \fBgetenv\fR will return \fBNULL\fR\. . .IP E\.g\. \fBkdb set user/env/fallback/HOME /path/to/home\fR . .IP "" 0 . .SH "OPTIONS" When \fBelektrify\-getenv\fR is active, every application additionally accepts Elektra\'s getenv options\. Interleaving Elektra\'s and the application\'s options is allowed\. Elektra will parse its options (starting with \-\-elektra) first and discard them before the other application is started\. Therefore the application will not see that they even existed, e\.g\.: given \fBkdb elektrify\-getenv \-V \-\-elektra\-debug \-L\fR the application will be called with \fB \-V \-L\fR\. . .SS "Internal Options" . .TP \fB\-\-elektra\-help\fR Outputs this help\. . .TP \fB\-\-elektra\-version\fR Gives version information\. . .TP \fB\-\-elektra\-debug=file\fR, \fBELEKTRA_DEBUG\fR or \fB/env/option/debug\fR Trace all getenv(3) calls to a file\. stderr if no file is given, e\.g\. \fBkdb set user/env/option/debug ""\fR\. Note that null values (no forth argument), will disable debug messages\. See examples below\. . .TP \fB\-\-elektra\-clearenv\fR, \fBELEKTRA_CLEARENV\fR or \fB/env/option/clearenv\fR Call clearenv(3) before entering main\. This is a recommended security feature\. Elektra itself, if configured that way, will still be able to use the environment\. . .TP \fB\-\-elektra\-reload\-timeout=time_in_ms\fR, \fBELEKTRA_RELOAD_TIMEOUT\fR or \fB/env/option/reload_timeout\fR Activate a timeout based feature when a time is given in ms (and is not 0)\. . .P Internal Options are available in three different variants: . .IP "1." 4 as commandline parameter: \fB\-\-elektra\-