------------------------------------------------------------
revno: 1422
committer: James Hunt <[email protected]>
branch nick: upstart-setenv+getenv
timestamp: Mon 2013-01-28 10:10:15 +0000
message:
  * init/control.c:
    - control_get_env(): Allow PID 1 environment to be queried for
      consistency with control_list_env().
  * init/man/initctl.8:
    - Added --job, --instance, --global options for list-env, set-env,
      get-env, unset-env, reset-env.
    - Explain PID 1 limitation for set-env, unset-env, reset-env.
modified:
  ChangeLog
  init/control.c
  util/man/initctl.8


--
lp:upstart
https://code.launchpad.net/~upstart-devel/upstart/trunk

Your team Upstart Reviewers is subscribed to branch lp:upstart.
To unsubscribe from this branch go to 
https://code.launchpad.net/~upstart-devel/upstart/trunk/+edit-subscription
=== modified file 'ChangeLog'
--- ChangeLog	2013-01-25 20:08:49 +0000
+++ ChangeLog	2013-01-28 10:10:15 +0000
@@ -1,3 +1,13 @@
+2013-01-28  James Hunt  <[email protected]>
+
+	* init/control.c:
+	  - control_get_env(): Allow PID 1 environment to be queried for
+	    consistency with control_list_env().
+	* init/man/initctl.8:
+	  - Added --job, --instance, --global options for list-env, set-env,
+	    get-env, unset-env, reset-env.
+	  - Explain PID 1 limitation for set-env, unset-env, reset-env.
+
 2013-01-25  James Hunt  <[email protected]>
 
 	* dbus/com.ubuntu.Upstart.xml:

=== modified file 'init/control.c'
--- init/control.c	2013-01-25 20:08:49 +0000
+++ init/control.c	2013-01-28 10:10:15 +0000
@@ -1403,11 +1403,6 @@
 
 		/* this can be a null value */
 		instance = job_details[1];
-	} else if (getpid () == 1) {
-		nih_dbus_error_raise_printf (
-			DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
-			_("Not permissable to modify PID 1 job environment"));
-		return -1;
 	}
 
 	/* Verify that job name is valid */

=== modified file 'util/man/initctl.8'
--- util/man/initctl.8	2013-01-25 20:02:26 +0000
+++ util/man/initctl.8	2013-01-28 10:10:15 +0000
@@ -556,51 +556,178 @@
 .\"
 .TP
 .B list\-env
+.RI [ OPTIONS "]
 
 Display a lexicographically sorted list of all variables and their
-values in the job environment table.
-
-Note that this table only includes the minimal set of standard system
-variables added by the
+values in a job environment table.
+
+When run from within a job, this command will automatically query the
+job-specific environment table; otherwise the global environment table
+that is applied to all jobs when they first start is queried.
+
+Note that the global job environment table only includes the minimal set
+of standard system variables added by the
 .BR init (8)
 daemon along with any variables set using
 .BR set\-env "."
 See
 .BR init (5)
 for further details.
+
+.B OPTIONS
+.RS
+.IP "\fB\-j\fP, \fB\-\-job\fP"
+Operate on the job environment table for the specified job. This option is
+implied when run from within a job.
+.RE
+.RS
+.IP "\fB\-i\fP, \fB\-\-instance\fP"
+Operate on the job environment table for the specified job instance
+(requires \fI\-\-job\fR). This option is implied when run from within a
+job.
+.RE
+.RS
+.IP "\fB\-g\fP, \fB\-\-global\fP"
+Operate on the global job environment table. This option is implied when not
+run from within a job.
+.RE
 .\"
 .TP
 .B get\-env
-.I VARIABLE
-
-Query the value of the specified variable in the job environment table.
+.RI [ OPTIONS "] " VARIABLE
+
+Display the value of the specified variable in a job environment table.
+
+When run from within a job, this command will automatically query the
+job-specific environment table; otherwise the global environment table
+that is applied to all jobs when they first start is queried.
+
+.B OPTIONS
+.RS
+.IP "\fB\-j\fP, \fB\-\-job\fP"
+Operate on the job environment table for the specified job. This option is
+implied when run from within a job.
+.RE
+.RS
+.IP "\fB\-i\fP, \fB\-\-instance\fP"
+Operate on the job environment table for the specified job instance
+(requires \fI\-\-job\fR). This option is implied when run from within a
+job.
+.RE
+.RS
+.IP "\fB\-g\fP, \fB\-\-global\fP"
+Operate on the global job environment table. This option is implied when not
+run from within a job.
+.RE
 .\"
 .TP
 .B set\-env
 .RI [ OPTIONS "] " VARIABLE[=VALUE]
 
-Adds or updates a variable in the job environment table. Variables set
+Adds or updates a variable in a job environment table. Variables set
 in this way will apply to all subsequently-starting jobs.
 
+This command is only permitted When running in
+.B User Session Mode.
+See 
+.BR init (5)
+for further details.
+
 .B OPTIONS
 .RS
 .IP "\fB\-r\fP, \fB\-\-retain\fP"
-
 If the specified variable is already set, do not modify it.
 .RE
+.RS
+.IP "\fB\-j\fP, \fB\-\-job\fP"
+Operate on the job environment table for the specified job. This option is
+implied when run from within a job.
+.RE
+.RS
+.IP "\fB\-i\fP, \fB\-\-instance\fP"
+Operate on the job environment table for the specified job instance
+(requires \fI\-\-job\fR). This option is implied when run from within a
+job.
+.RE
+.RS
+.IP "\fB\-g\fP, \fB\-\-global\fP"
+Operate on the global job environment table. This option is implied when not
+run from within a job.
+.RE
 .\"
 .TP
 .B unset\-env
-.I VARIABLE
+.RI [ OPTIONS "] " VARIABLE
 
-Remove the specified variable from the job environment table. If the
+Remove the specified variable from a job environment table. If the
 variable does not already exist in the table, no change will be made.
+
+This command is only permitted When running in
+.B User Session Mode.
+See 
+.BR init (5)
+for further details.
+
+.B OPTIONS
+.RS
+.IP "\fB\-r\fP, \fB\-\-retain\fP"
+If the specified variable is already set, do not modify it.
+.RE
+.RS
+.IP "\fB\-j\fP, \fB\-\-job\fP"
+Operate on the job environment table for the specified job. This option is
+implied when run from within a job.
+.RE
+.RS
+.IP "\fB\-i\fP, \fB\-\-instance\fP"
+Operate on the job environment table for the specified job instance
+(requires \fI\-\-job\fR). This option is implied when run from within a
+job.
+.RE
+.RS
+.IP "\fB\-g\fP, \fB\-\-global\fP"
+Operate on the global job environment table. This option is implied when not
+run from within a job.
+.RE
 .\"
 .TP
 .B reset\-env
+.R [ OPTIONS ]
 
-Discards all changes make to the job environment table, setting it back
+Discards all changes make to a job environment table, setting it back
 to its default set of variables and values.
+
+This command is only permitted When running in
+.B User Session Mode.
+See 
+.BR init (5)
+for further details.
+
+Note that the effect of the Session Init process that manages the User
+Session Mode restarting is equivalent to this command having been
+called.
+
+.B OPTIONS
+.RS
+.IP "\fB\-r\fP, \fB\-\-retain\fP"
+If the specified variable is already set, do not modify it.
+.RE
+.RS
+.IP "\fB\-j\fP, \fB\-\-job\fP"
+Operate on the job environment table for the specified job. This option is
+implied when run from within a job.
+.RE
+.RS
+.IP "\fB\-i\fP, \fB\-\-instance\fP"
+Operate on the job environment table for the specified job instance
+(requires \fI\-\-job\fR). This option is implied when run from within a
+job.
+.RE
+.RS
+.IP "\fB\-g\fP, \fB\-\-global\fP"
+Operate on the global job environment table. This option is implied when not
+run from within a job.
+.RE
 .\"
 .TP
 .B usage

-- 
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to