From owner-freebsd-questions@FreeBSD.ORG Thu Apr 13 22:16:31 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9255016A467 for ; Thu, 13 Apr 2006 22:16:31 +0000 (UTC) (envelope-from mhunter@malcolm.berkeley.edu) Received: from malcolm.berkeley.edu (malcolm.Berkeley.EDU [128.32.206.239]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FF6443D45 for ; Thu, 13 Apr 2006 22:16:31 +0000 (GMT) (envelope-from mhunter@malcolm.berkeley.edu) Received: from malcolm.berkeley.edu (localhost [127.0.0.1]) by malcolm.berkeley.edu (8.13.6/8.13.3) with ESMTP id k3DMGVvN050957 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 13 Apr 2006 15:16:31 -0700 (PDT) (envelope-from mhunter@malcolm.berkeley.edu) Received: (from mhunter@localhost) by malcolm.berkeley.edu (8.13.6/8.13.3/Submit) id k3DMGUX4050956 for freebsd-questions@freebsd.org; Thu, 13 Apr 2006 15:16:31 -0700 (PDT) (envelope-from mhunter) Date: Thu, 13 Apr 2006 15:16:30 -0700 From: Mike Hunter To: freebsd-questions@freebsd.org Message-ID: <20060413221630.GA50540@malcolm.berkeley.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (malcolm.berkeley.edu [127.0.0.1]); Thu, 13 Apr 2006 15:16:31 -0700 (PDT) Subject: /usr/local/etc/rc.d and role accounts X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2006 22:16:31 -0000 Hi, I'm hoping to get into the spirit of the new rc.d script specs (REQUIRES, PROVIDES, command=, etc) on a new server I'm building. The old script I was using looked like this: /usr/local/etc/rc.d/start-all-foo.sh [ -x /usr/local/bin/foo ] && su foo-role -c "/usr/local/bin/foo bar" [ -x /usr/local/bin/foo ] && su foo-role -c "/usr/local/bin/foo baz" [ -x /usr/local/bin/foo ] && su foo-role -c "/usr/local/bin/foo bof" ... I have several questions about how to replicate this behavior. I'm still deciding whether I'm willing to split out the 10 or so instances into separate scripts...if I didn't want to do that, is the best way to handle it to create a script with all 10 command and then have the rc script run that script? How do I replicate the su stuff? I could say command=su and foo_flags="foo-role -c ..." but that doesn't seem very good. As a bonus, foo would like to make pid files, but /var/run isn't writable to foo-role. What's the standard way to handle where to put the pid files? Thanks! Mike