LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-26-2012, 05:14 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Rep: Reputation: 33
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
 
Old 07-26-2012, 07:03 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 14,840

Rep: Reputation: 4878Reputation: 4878Reputation: 4878Reputation: 4878Reputation: 4878Reputation: 4878Reputation: 4878Reputation: 4878Reputation: 4878Reputation: 4878Reputation: 4878
obviously yes
 
Old 07-26-2012, 08:51 AM   #3
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by pan64 View Post
obviously yes
But if I add the user to the sudoers?
 
Old 07-26-2012, 09:17 AM   #4
Sydney
Member
 
Registered: Mar 2012
Distribution: Scientific Linux
Posts: 147

Rep: Reputation: 36
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
 
Old 07-26-2012, 09:13 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,782

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run as daemon? bjh SUSE / openSUSE 1 11-08-2008 12:56 PM
Enable daemon to run with service daemon start,etc baddah Programming 6 12-02-2007 05:51 PM
HAL Daemon does not run Jason Bao Linux - Kernel 2 09-14-2006 06:57 AM
how to run a program as a daemon? iclinux Linux - Newbie 2 04-20-2005 12:11 AM
run as a daemon dellcom1800 Linux - Software 6 10-15-2004 07:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration