From owner-freebsd-questions@FreeBSD.ORG Fri Apr 14 16:35:59 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 1AD4E16A400 for ; Fri, 14 Apr 2006 16:35:59 +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 CE83943D46 for ; Fri, 14 Apr 2006 16:35:58 +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 k3EGZwFP080978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 14 Apr 2006 09:35:58 -0700 (PDT) (envelope-from mhunter@malcolm.berkeley.edu) Received: (from mhunter@localhost) by malcolm.berkeley.edu (8.13.6/8.13.3/Submit) id k3EGZw3l080977 for freebsd-questions@freebsd.org; Fri, 14 Apr 2006 09:35:58 -0700 (PDT) (envelope-from mhunter) Date: Fri, 14 Apr 2006 09:35:58 -0700 From: Mike Hunter To: freebsd-questions@freebsd.org Message-ID: <20060414163558.GA80631@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]); Fri, 14 Apr 2006 09:35:58 -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: Fri, 14 Apr 2006 16:35:59 -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