NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rc and login classes





On 07/07/17 15:11, Alexander Nasonov wrote:
Edgar Pettijohn wrote:
Look at rc.subr. it calls su to start the daemon. Look at the
manual for rc.subr I think there are some variables you could add
to the rc.d script to change the behavior.
I only see su -m user -c ... in rc.subr. It's not the same as su -c class user.

$ man su
..
      When a -c option is included after the login name it is not a su option,
      because any arguments after the login are passed to the shell.  (See
      csh(1), ksh(1) or sh(1) for details.)  To execute arbitrary command with
      privileges of user username, execute:

            su username -c "command args"

I think you can do the following in rc.conf:

tor_cmd="su -c class -m user -c 'sh -c /path/to/tor args'"

obviously change class, user, and the correct path.


Home | Main Index | Thread Index | Old Index