From owner-freebsd-questions@FreeBSD.ORG Sat Feb 14 04:28:43 2004 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 7255516A4CE for ; Sat, 14 Feb 2004 04:28:43 -0800 (PST) Received: from radicalv.com (secure.radicalv.com [216.118.91.10]) by mx1.FreeBSD.org (Postfix) with SMTP id 15D8843D1D for ; Sat, 14 Feb 2004 04:28:43 -0800 (PST) (envelope-from ecrist@adtechintegrated.com) Received: (qmail 70255 invoked from network); 14 Feb 2004 12:28:38 -0000 Received: from unknown (HELO localhost.invalid) (63.228.14.245) by mail.radicalv.com with SMTP; 14 Feb 2004 12:28:38 -0000 From: Eric F Crist Organization: AdTech Integrated Systems, Inc To: freebsd-questions@freebsd.org Date: Sat, 14 Feb 2004 06:28:29 -0600 User-Agent: KMail/1.6 References: <20040214004739.GD650@keyslapper.org> <20040213200721.F67547@admin1.mdc.net> <402DE3CC.10603@geminix.org> In-Reply-To: <402DE3CC.10603@geminix.org> MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_1RhLAWwSKXXmq+W"; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200402140628.38226.ecrist@adtechintegrated.com> cc: Uwe Doering Subject: Re: startup daemon as unpriviliged user X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ecrist@adtechintegrated.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2004 12:28:43 -0000 --Boundary-02=_1RhLAWwSKXXmq+W Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 14 February 2004 03:01 am, Uwe Doering wrote: > matthew wrote: > > On Fri, 13 Feb 2004, Louis LeBlanc wrote: > >>[...] > >>So, how can I get a process to run automatically on startup for an > >>unprivileged user? > > > > cd /usr/local/etc/rc.d > > > > make a small sh script like so: > > > > #!/bin/sh > > su username -c "command" > > For scripts in '/usr/local/etc/rc.d' one should stick to the required > semantics. That is, in this particular case you need to make sure that > it only runs on startup and not a second time on shutdown. Like so: > > ------------------------ cut here ------------------------ > #!/bin/sh > > case "$1" in > start) > su username -c "command" > ;; > stop) > ;; > esac > ------------------------ cut here ------------------------ > > Also, keep in mind that the script's name requires a suffix of '.sh', or > else the system won't execute it automatically. > > Uwe I think you could also setuid for that user to the shell script. =2D-=20 Eric F Crist AdTech Integrated Systems, Inc (612) 998-3588 --Boundary-02=_1RhLAWwSKXXmq+W Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBALhR1zdyDbTMRQIYRAq43AJwJH1RZi0bYxxnsXkHMpEc5Sh7KuwCgwcFW RVe2mM0DK3emsiI5nMnR+u4= =rjoY -----END PGP SIGNATURE----- --Boundary-02=_1RhLAWwSKXXmq+W--