From owner-freebsd-bugs@FreeBSD.ORG Tue May 23 15:40:52 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EAFFA16A610 for ; Tue, 23 May 2006 15:40:52 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D25C243DAA for ; Tue, 23 May 2006 15:40:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k4NFeIED053682 for ; Tue, 23 May 2006 15:40:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k4NFeIlJ053681; Tue, 23 May 2006 15:40:18 GMT (envelope-from gnats) Resent-Date: Tue, 23 May 2006 15:40:18 GMT Resent-Message-Id: <200605231540.k4NFeIlJ053681@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Deyan Dyankov Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6AF4F16A4CC for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: misc/97697: [PATCH] rc.conf - jail__exec_afterstart[0..n] X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 May 2006 15:40:53 -0000 >Number: 97697 >Category: misc >Synopsis: [PATCH] rc.conf - jail__exec_afterstart[0..n] >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue May 23 15:40:18 GMT 2006 >Closed-Date: >Last-Modified: >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: >Unformatted: