public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Grant <emailgrant@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Starting a daemon automatically without rc-update
Date: Wed, 12 Aug 2009 16:53:28 -0700	[thread overview]
Message-ID: <49bf44f10908121653i404d74acla048ccf31ba5dea1@mail.gmail.com> (raw)
In-Reply-To: <20090812230258.4f31b6b9@zaphod.digimed.co.uk>

>> 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?
>>
>> # cat /etc/init.d/rc.local
>> #!/sbin/runscript
>>
>> 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.
>
>
> --
> Neil Bothwick

Hmmm, it didn't come back up with the server.  I have this in
/etc/init.d/rc.local:

#!/sbin/runscript
depend() {
}
start() {
su - user -c /path/to/binary
}
stop() {
}
restart() {
}

I had to start it like I normally do instead:

# su - user
$ /path/to/binary

What could I be missing?

- Grant



  parent reply	other threads:[~2009-08-12 23:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-12 21:40 [gentoo-user] Starting a daemon automatically without rc-update Grant
2009-08-12 22:02 ` Neil Bothwick
2009-08-12 22:50   ` [OT] " Peter Humphrey
2009-08-12 23:53   ` Grant [this message]
2009-08-13  0:55     ` Neil Bothwick
2009-08-13  5:12       ` Grant
2009-08-13 14:53       ` Dale
2009-08-13 20:17         ` Neil Bothwick
2009-08-13  1:30     ` [gentoo-user] " Nikos Chantziaras
2009-08-13  1:18   ` [gentoo-user] " Keith Dart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49bf44f10908121653i404d74acla048ccf31ba5dea1@mail.gmail.com \
    --to=emailgrant@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox