LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Who can run the daemon ? (https://www.linuxquestions.org/questions/linux-software-2/who-can-run-the-daemon-4175418750/)

thomas2004ch 07-26-2012 05:14 AM

Who can run the daemon ?
 
Hi,

I have a script which contains a command:

Code:

...
daemon --user $JBOSS_USER LAUNCH_JBOSS_IN_BACKGROUND=1
...

As I run this script under root there is no problem. But as I run this script under other user I got error as:

Code:

runuser: cannot set groups: Operation not permitted
Can only root run the daemon?

Thomas

pan64 07-26-2012 07:03 AM

obviously yes

thomas2004ch 07-26-2012 08:51 AM

Quote:

Originally Posted by pan64 (Post 4738490)
obviously yes

But if I add the user to the sudoers?

Sydney 07-26-2012 09:17 AM

If you sudo the script without adding a -u option you will still be running it as root, just without the environmental variables of root and without having to log in as root. It is not clear if that would be the intended result from your question.

Quote:

Last login: Thu Jul 19 22:18:09 2012
user@server:~$ sudo whoami
[sudo] password for user:
root

chrism01 07-26-2012 09:13 PM

You can use the RUNAS option in sudoers file to cause it to run as root.


All times are GMT -5. The time now is 08:56 PM.