From owner-freebsd-questions@FreeBSD.ORG Thu Jan 6 16:07:55 2005 Return-Path: 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 146AB16A4CE for ; Thu, 6 Jan 2005 16:07:55 +0000 (GMT) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id A3D6F43D3F for ; Thu, 6 Jan 2005 16:07:53 +0000 (GMT) (envelope-from nkinkade@fastmail.fm) Received: from frontend3.messagingengine.com (frontend3.internal [10.202.2.152]) by frontend1.messagingengine.com (Postfix) with ESMTP id B1B38C4A442; Thu, 6 Jan 2005 11:07:52 -0500 (EST) X-Sasl-enc: eEaDNd2xXsHEv9d+Yb0qkA 1105027672 Received: from gentoo-npk.bmp.ub (unknown [206.27.244.136]) by www.fastmail.fm (Postfix) with ESMTP id 274392553F; Thu, 6 Jan 2005 11:07:51 -0500 (EST) Received: from nkinkade by gentoo-npk.bmp.ub with local (Exim 4.21) id 1CmaAv-0002h7-G9; Thu, 06 Jan 2005 10:07:49 -0600 Date: Thu, 6 Jan 2005 10:07:49 -0600 From: Nathan Kinkade To: "J.D. Bronson" Message-ID: <20050106160749.GE3639@gentoo-npk.bmp.ub> Mail-Followup-To: "J.D. Bronson" , freebsd-questions@freebsd.org References: <6.2.0.14.2.20050106080413.00c43fe8@cheyenne.wixb.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DRp5/Sds4nAqvQzf" Content-Disposition: inline In-Reply-To: <6.2.0.14.2.20050106080413.00c43fe8@cheyenne.wixb.com> User-Agent: Mutt/1.5.6i Sender: cc: freebsd-questions@freebsd.org Subject: Re: 5.3 - starting a process as a diff user X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Nathan Kinkade List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2005 16:07:55 -0000 --DRp5/Sds4nAqvQzf Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 06, 2005 at 08:05:41AM -0600, J.D. Bronson wrote: > I have a daemon that I need to start at boot under > /usr/local/etc/rc.d >=20 > and I need it to run as a specific user. >=20 > Currently, from root, I su - {userid} and then launch it > and then log out. >=20 > Can I make this automated in /usr/local/etc/rc.d and if so how? >=20 > Thanks :) >=20 > -JEFF You can use su(1) to do this, too. Look into the -c option. So, someting in your script like: su someuser -c "/usr/bin/someprogram" =2E.. should do what you need. Nathan --DRp5/Sds4nAqvQzf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFB3WJVO0ZIEthSfkkRApdAAKCJvVIgnasbuaJEy2oVozSoyWhm+QCfV7lF 7TcpShSMD0zBNQvyWEqZwRs= =BKiz -----END PGP SIGNATURE----- --DRp5/Sds4nAqvQzf--