Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know how to fork to process. That is not a problem. But my issue is a little different. Example inittab line:

::respawn:-/usr/bin/python /path/to/script.py && /bin/sh -l -c 'chown user1:user1 /tmp/file'

As far as I know this works for normal situations. But this python script is a long-run process. As it doesn't end, the second part of line is not executed. At least that's what I thought. '/tmp/file' is created by this python script. That's why I am trying to use one line. As soon as python script restarted, I should change ownership of the mentioned file. I can hear you saying 'change the script'. So true. It is not that hard. But I am eager to know how to do that with inittab or something else?

Edit: Is there a way to run this python script with another user than root within inittab?

I am using a busybox installation.

share|improve this question

1 Answer 1

::respawn:-/usr/bin/python /path/to/script.py & /bin/sh -l -c 'chown user1:user1 /tmp/file'

share|improve this answer
    
In this case it keeps forking processes. Because of 'respawn'. But I also need that. I need python script running all the time but changing ownership should run only once and then die. And now I guess it is not possible with only inittab. As everytime 'chown' dies it forks python script again and again. Is there a way to run this python script with another user than root within inittab? –  savruk Oct 19 '11 at 9:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.