Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] nohup and user permission
View unanswered posts
View posts from last 24 hours

rackathon
 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
celticsoul
n00b
n00b


Joined: 04 Dec 2006
Posts: 10

PostPosted: Thu Mar 13, 2008 6:58 am    Post subject: [SOLVED] nohup and user permission Reply with quote

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
View user's profile Send private message
_ph
l33t
l33t


Joined: 23 Mar 2006
Posts: 958
Location: Poland

PostPosted: Thu Mar 13, 2008 7:08 am    Post subject: Reply with quote

The first thing I would suspect would be /opt/jimy/jimy.sh not being executable.
Back to top
View user's profile Send private message
celticsoul
n00b
n00b


Joined: 04 Dec 2006
Posts: 10

PostPosted: Thu Mar 13, 2008 7:14 am    Post subject: Reply with quote

_ph, thanks for replying.
What if /opt/jimy/jimy is 770? or even 777
Any other idea?
Back to top
View user's profile Send private message
_ph
l33t
l33t


Joined: 23 Mar 2006
Posts: 958
Location: Poland

PostPosted: Thu Mar 13, 2008 7:18 am    Post subject: Reply with quote

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
View user's profile Send private message
JeliJami
Veteran
Veteran


Joined: 17 Jan 2006
Posts: 1082
Location: Belgium

PostPosted: Thu Mar 13, 2008 7:34 am    Post subject: Reply with quote

how about making the /opt/jimy/jimy.sh script jim's default shell,
and then
Code:
su - jim

_________________
Unanswered Post Initiative | Search | FAQ
Former username: davjel
Back to top
View user's profile Send private message
celticsoul
n00b
n00b


Joined: 04 Dec 2006
Posts: 10

PostPosted: Fri Mar 14, 2008 3:37 am    Post subject: Reply with quote

Thank you guys,
It was permission problem like _ph said.
the file jimy.sh must be excutable.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum