From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1MbLuP-0001jI-I9 for garchives@archives.gentoo.org; Wed, 12 Aug 2009 22:03:01 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3479AE054C; Wed, 12 Aug 2009 22:03:00 +0000 (UTC) Received: from mail.digimed.co.uk (82-69-83-178.dsl.in-addr.zen.co.uk [82.69.83.178]) by pigeon.gentoo.org (Postfix) with ESMTP id 0299AE054C for ; Wed, 12 Aug 2009 22:03:00 +0000 (UTC) Received: from zaphod.digimed.co.uk (zaphod.digimed.co.uk [192.168.1.1]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.digimed.co.uk (Postfix) with ESMTPSA id 6747D410225 for ; Wed, 12 Aug 2009 23:02:59 +0100 (BST) Date: Wed, 12 Aug 2009 23:02:58 +0100 From: Neil Bothwick To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Starting a daemon automatically without rc-update Message-ID: <20090812230258.4f31b6b9@zaphod.digimed.co.uk> In-Reply-To: <49bf44f10908121440o3764f861r6dfddcc4c4ce91c@mail.gmail.com> References: <49bf44f10908121440o3764f861r6dfddcc4c4ce91c@mail.gmail.com> Organization: Digital Media Production X-Mailer: Claws Mail 3.7.2cvs16 (GTK+ 2.16.5; x86_64-pc-linux-gnu) X-GPG-Fingerprint: 7260 0F33 97EC 2F1E 7667 FE37 BA6E 1A97 4375 1903 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/Ojt8/WLmA6IoGEx91G+cZqI"; protocol="application/pgp-signature" X-Archives-Salt: 1417a650-c9a5-4f36-8934-0d76815d2ad7 X-Archives-Hash: 9a4123313756fedc5d95ce4d09b2e4fe --Sig_/Ojt8/WLmA6IoGEx91G+cZqI Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 12 Aug 2009 14:40:49 -0700, Grant wrote: > I run one program which needs to be started as a particular user > whenever the system comes up, but there is no ebuild. Is this the > Gentoo way? >=20 > # cat /etc/init.d/rc.local > #!/sbin/runscript >=20 > start() { > su user > /path/to/program/binary > } Yes, or you could use start() { su - user -c /path/to/program/binary } which runs the program with the user's full environment instead of inheriting root's. --=20 Neil Bothwick C: (n.) the language following A and B. The world still awaits D and E. By Z, it may be acceptable for general use. --Sig_/Ojt8/WLmA6IoGEx91G+cZqI Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) iEYEARECAAYFAkqDPBIACgkQum4al0N1GQP4UwCeNxEZXCr1hRMB93viWUVN/xfK VIoAn0WTYzWkhqQAZ/k4uGA/wayQCw/Z =Z1nv -----END PGP SIGNATURE----- --Sig_/Ojt8/WLmA6IoGEx91G+cZqI--