1

Been fighting with Linux for the past few days. For whatever reason I can't start my service as a specific user. If I try to start my service as a specific user it will not work:

sudo -u logAdmin /sbin/service logService start

However; if I run the service as the root user it will start.

sudo /sbin/service logService start

I am not really sure how fix this. The user definitely exists. When I check for the user using:

grep "^logAdmin" /etc/passwd

I get back:

logAdmin:x:600:600:logAdmin Application Account:/app:/bin/bash

I also made to give appropriate permissions to the script

/etc/init.d and sh files with:

chown logAdmin:logAdmin /app/logService

And I registered the service:

/sbin/chkconfig logService on

I also checked the permission of my user on the init script and got back:

-rwxr-xr-x 1 logAdmin logAdmin 1228 May 11 17:39 /etc/init.d/logService

I have tried everything to get this working! Why is it running the sudo root user but won't run when I try to start it as another user??

Kevin
  • 2,852
  • 6
  • 21
  • 33

1 Answers1

3

service must be run as root. The initscript is responsible for starting the application as a different user.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358