| View previous topic :: View next topic |
| Author |
Message |
celticsoul n00b

Joined: 04 Dec 2006 Posts: 10
|
Posted: Thu Mar 13, 2008 6:58 am Post subject: [SOLVED] nohup and user permission |
|
|
I have an ebuild which creates a user (lets say jimy) and set home dir to a proper dir (/opt/jim), login shell to /bin/nologin, and set the owenership, permission...
The ebuild also makes a init file in which contains
su -s /bin/bash -c "/usr/bin/nohup /opt/jimy/jimy.sh &" jimy
which returns "Permission denied"
I guest that since jimy's login shell is /bin/nologin, this makes him unable to run any command at all including /usr/bin/nohup
What is the correct way of doing this?
Thanks.
Last edited by celticsoul on Fri Mar 14, 2008 3:38 am; edited 1 time in total |
|
| Back to top |
|
 |
_ph l33t


Joined: 23 Mar 2006 Posts: 958 Location: Poland
|
Posted: Thu Mar 13, 2008 7:08 am Post subject: |
|
|
| The first thing I would suspect would be /opt/jimy/jimy.sh not being executable. |
|
| Back to top |
|
 |
celticsoul n00b

Joined: 04 Dec 2006 Posts: 10
|
Posted: Thu Mar 13, 2008 7:14 am Post subject: |
|
|
_ph, thanks for replying.
What if /opt/jimy/jimy is 770? or even 777
Any other idea? |
|
| Back to top |
|
 |
_ph l33t


Joined: 23 Mar 2006 Posts: 958 Location: Poland
|
Posted: Thu Mar 13, 2008 7:18 am Post subject: |
|
|
Try to detect the exact cause of the problem.
1. Read man pages of su and nohup to make sure they behave like you suppose them to (or that you use them like they're supposed to).
2. Try using same command with something different than jimy.sh, like date etc. - simple, but guaranteed to work.
3. Try to give jimy a temporary shell.
4. Try to leave out nohup.
After these experiments you should get a pretty good picture which part of the equation is causing the problem. |
|
| Back to top |
|
 |
JeliJami Veteran


Joined: 17 Jan 2006 Posts: 1082 Location: Belgium
|
Posted: Thu Mar 13, 2008 7:34 am Post subject: |
|
|
how about making the /opt/jimy/jimy.sh script jim's default shell,
and then
_________________ Unanswered Post Initiative | Search | FAQ
Former username: davjel |
|
| Back to top |
|
 |
celticsoul n00b

Joined: 04 Dec 2006 Posts: 10
|
Posted: Fri Mar 14, 2008 3:37 am Post subject: |
|
|
Thank you guys,
It was permission problem like _ph said.
the file jimy.sh must be excutable. |
|
| Back to top |
|
 |
|