From owner-freebsd-current@FreeBSD.ORG Tue May 13 20:30:37 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1495237B401 for ; Tue, 13 May 2003 20:30:37 -0700 (PDT) Received: from mail.westbend.net (ns1.westbend.net [216.47.253.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4175243FA3 for ; Tue, 13 May 2003 20:30:36 -0700 (PDT) (envelope-from hetzels@westbend.net) Received: from Admin02 (admin02.westbend.net [216.47.253.19]) by mail.westbend.net (8.12.9/8.12.9) with SMTP id h4E3UWV4062286; Tue, 13 May 2003 22:30:33 -0500 (CDT) (envelope-from hetzels@westbend.net) Message-ID: <098501c319c9$3559bbe0$13fd2fd8@Admin02> From: "Scot W. Hetzel" To: "Lucky Green" References: <003b01c316d2$9f58dc50$6a01a8c0@VAIO650> Date: Tue, 13 May 2003 22:30:46 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-Spam-Status: No, hits=-0.6 required=8.0 tests=QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_01_02, USER_AGENT_OE version=2.43 cc: freebsd-current@freebsd.org Subject: Re: Port startup scripts under rcNG? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2003 03:30:37 -0000 From: "Lucky Green" > What is the correct place in the FreeBSD file system for a Port startup > script that executes a program as a specific user under rcNG? And where > can I find a sample of such a script? > An example of a combined rcNG/OG script is in security/cyrus-sasl. Your rcNG portion of the script may look like the following: name="mydaemon" rcvar=`set_rcvar` mydaemon_user="testuser" command="${prefix}/sbin/${name}" pidfile="/var/run/${name}.pid" load_rc_config $name run_rc_command "$1" by adding mydaemon_user to the rcNG portion of the script, we execute ${command}as that user. For more info on the variables available to run_rc_command, look at it's entry in /etc/rc.subr. Scot