2

Background:

I'm a Ubuntu/Debian fan and most of my development experience has been on that platform but my current employer uses Redhat. I needed to write a simple init.d script and want the resulting program to run as an unprivileged user. Most resources I found suggest using the daemon function in lieu of start-stop-daemon.

Question:

Why doesn't the daemon function have an option to set the group like the start-stop-daemon? I'm sure there must be a reason for this, just not sure what that reason is.

1 Answer 1

0

You can certainly change the daemon function to set the group or you can write your own mydaemon function to do it.

Or in a simplest possible way just call the runuser command that daemon() uses to start your program with particular UID and GID

2
  • So there is no reason why it couldn't/shouldn't set group, for what ever reason it just doesn't? Commented Sep 15, 2012 at 16:23
  • @Jacks_Depression By default it should set the default group for the user as well. But if it doesn't you can change it. Commented Sep 15, 2012 at 16:47

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.