Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Starting a daemon automatically without rc-update
Date: Wed, 12 Aug 2009 22:03:01
Message-Id: 20090812230258.4f31b6b9@zaphod.digimed.co.uk
In Reply to: [gentoo-user] Starting a daemon automatically without rc-update by Grant
1 On Wed, 12 Aug 2009 14:40:49 -0700, Grant wrote:
2
3 > I run one program which needs to be started as a particular user
4 > whenever the system comes up, but there is no ebuild. Is this the
5 > Gentoo way?
6 >
7 > # cat /etc/init.d/rc.local
8 > #!/sbin/runscript
9 >
10 > start() {
11 > su user
12 > /path/to/program/binary
13 > }
14
15 Yes, or you could use
16
17 start() {
18 su - user -c /path/to/program/binary
19 }
20
21 which runs the program with the user's full environment instead of
22 inheriting root's.
23
24
25 --
26 Neil Bothwick
27
28 C: (n.) the language following A and B. The world still awaits D and
29 E. By Z, it may be acceptable for general use.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[OT] Re: [gentoo-user] Starting a daemon automatically without rc-update Peter Humphrey <peter@××××××××××××××.org>
Re: [gentoo-user] Starting a daemon automatically without rc-update Grant <emailgrant@×××××.com>
Re: [gentoo-user] Starting a daemon automatically without rc-update Keith Dart <keith@×××××××××.biz>