Date: Thu, 6 Jan 2005 10:07:49 -0600 From: Nathan Kinkade <nkinkade@ub.edu.bz> To: "J.D. Bronson" <jbronson@wixb.com> Cc: freebsd-questions@freebsd.org Subject: Re: 5.3 - starting a process as a diff user Message-ID: <20050106160749.GE3639@gentoo-npk.bmp.ub> In-Reply-To: <6.2.0.14.2.20050106080413.00c43fe8@cheyenne.wixb.com> References: <6.2.0.14.2.20050106080413.00c43fe8@cheyenne.wixb.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050106160749.GE3639>
