------------------------------------------------------------
revno: 1388
committer: James Hunt <[email protected]>
branch nick: upstart
timestamp: Mon 2012-11-19 09:48:17 +0000
message:
  * init/job_process.c: job_process_log_path(): Make chroot jobs log
    inside the chroot (LP: #1079710).
  * init/man/init.5:
    - State that jobs started from within a chroot are distinct from jobs
      specifying the chroot stanza.
    - State explicitly where chroot output is logged.
modified:
  init/job_process.c
  init/man/init.5


--
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 'init/job_process.c'
--- init/job_process.c	2012-11-14 14:47:19 +0000
+++ init/job_process.c	2012-11-19 09:48:17 +0000
@@ -2150,6 +2150,20 @@
 	if (! dir)
 		nih_return_no_memory_error (NULL);
 
+	/* If the job is running inside a chroot, it must be logged to a
+	 * file within the chroot.
+	 */
+	if (job->class->session && job->class->session->chroot) {
+		nih_local char *tmp = NULL;
+
+		tmp = NIH_MUST (nih_strdup (NULL, dir));
+		nih_free (dir);
+
+		dir = nih_sprintf (NULL, "%s%s",
+				job->class->session->chroot,
+				tmp);
+	}
+
 	class_name = nih_strdup (NULL, class->name);
 
 	if (! class_name)

=== modified file 'init/man/init.5'
--- init/man/init.5	2012-08-31 21:01:48 +0000
+++ init/man/init.5	2012-11-19 09:48:17 +0000
@@ -111,7 +111,11 @@
 facility. Note that it is not necessary to install D\-Bus within the
 chroot (in fact it is not recommended).
 
-Note that User Jobs can be created within a chroot environment.
+Note that this facility is distinct from the \fBchroot\fR stanza (see
+.B Process environment
+below).
+
+Note too that User Jobs can be created within a chroot environment.
 
 .\"
 .SS Configuration File Format
@@ -632,6 +636,9 @@
 .I <job>.log
 where \(aq<job>\(aq is replaced with the job name.
 
+Jobs started from within a chroot will have their output logged to such
+a path within the chroot.
+
 If log files already exist, they are appended to.
 
 All slash (\(aq/\(aq) characters in

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

Reply via email to