From nobody@FreeBSD.org  Tue May 23 15:31:32 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6AF4F16A4CC
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 23 May 2006 15:31:32 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3724D43D48
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 23 May 2006 15:31:32 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k4NFVWNI062768
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 23 May 2006 15:31:32 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k4NFVWIj062767;
	Tue, 23 May 2006 15:31:32 GMT
	(envelope-from nobody)
Message-Id: <200605231531.k4NFVWIj062767@www.freebsd.org>
Date: Tue, 23 May 2006 15:31:32 GMT
From: Deyan Dyankov <deyan.dyankov@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] rc.conf - jail_<j>_exec_afterstart[0..n]
X-Send-Pr-Version: www-2.3

>Number:         97697
>Category:       conf
>Synopsis:       [patch] rc.conf - jail_<j>_exec_afterstart[0..n]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    matteo
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 23 15:40:18 GMT 2006
>Closed-Date:    Sat Jun 19 04:43:24 UTC 2010
>Last-Modified:  Sat Jun 19 04:43:24 UTC 2010
>Originator:     Deyan Dyankov
>Release:        FreeBSD 6.1-STABLE
>Organization:
>Environment:
FreeBSD porky 6.1-STABLE FreeBSD 6.1-STABLE #1: Sat May 13 19:34:29 EEST 2006     root@:/usr/obj/usr/src/sys/PORKY  i386

>Description:
A common patch - nothing unusual.
My situation: I have a jail (web) running lighttpd. If I want to start the jail using /etc/rc.conf I simply put:
jail_web_rootdir="/j/web"
jail_web_hostname="web"
jail_web_ip="aaa.bbb.ccc.ddd"
jail_web_exec_start="/w/sbin/lighttpd -f /w/conf/lighttpd.conf"
jail_web_exec_stop=""
jail_web_devfs_enable="YES"
jail_web_devfs_ruleset="webjail"
jail_web_mount_enable="NO"

But what happens If I want to run proftpd in the same jail? Yes - I could write a simple shell script like this one:
#!/bin/sh
/w/sbin/lighttpd -f /w/conf/lighttpd.conf
/proftpd/sbin/proftpd

and run the shell script with jail_web_exec_start=""

BUT! I don't want /bin/sh installed (for obvious security reasons). The jail contains only the required libraries for its services.

I've patched /usr/src/etc/rc.d/jail in order to allow constructions like:

jail_web_exec_afterstart0="/proftpd/sbin/proftpd"
jail_web_exec_afterstart1="..."
jail_web_exec_afterstart2="..."

.and so on.
Here's the patch - http://88.80.96.36/jail.diff - I hope it'll be useful.
Sorry if there's something missing or wrong - this is my first patch for FreeBSD.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->matteo 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Sat May 27 11:49:46 UTC 2006 
Responsible-Changed-Why:  
I like this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=97697 
State-Changed-From-To: open->feedback 
State-Changed-By: matteo 
State-Changed-When: Sun May 28 07:18:28 UTC 2006 
State-Changed-Why:  
It seems the server with the patch is not responding. Can you please 
send me the patch ?(unified diff preferred :) ) Thanks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=97697 
State-Changed-From-To: feedback->patched 
State-Changed-By: matteo 
State-Changed-When: Tue May 30 16:29:11 UTC 2006 
State-Changed-Why:  
Committed to HEAD, I'll MFC it in 2 weeks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=97697 
State-Changed-From-To: patched->closed 
State-Changed-By: linimon 
State-Changed-When: Sat Jun 19 04:43:10 UTC 2010 
State-Changed-Why:  
This PR is OBE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=97697 
>Unformatted:
