开发者

Executing python script in background in init.d

to interact with my iPhone, i have created a python script that sends and recives data through a socket, the script must be started after emule in order to work, i have thought of something like this:

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEM开发者_JAVA技巧ON=/usr/local/bin/amuled
WEB=/usr/local/bin/amuleweb
NAME=amuled
DESC=amuled
RUNAMULE=no
USER=piros
# ADDED FOR iPhone
SOCKET= /home/piros/amule_scripts/aMuleSocket/aMuleSocket.py
#

And then

case "$1" in
start)
  echo -n "Starting $DESC: "
   su $USER -c "$DAEMON -f"
   while ! netstat -l -n -p -t | grep -q amuled ; do sleep 1 ; done
   su $USER -c "$WEB --quiet & "
   ##iPhone
   su $USER -c "$SOCKET & "
   ##
echo "$NAME."
;;

The big problem is, although i specified the & sign the process dosen't want to run in background :( any ideas??

Thanks!


Put the su process in the background, not its child. For example:

su $USER -c "$WEB --quiet" &

Notice that the ampersand is outside the quotes.


try launching with nohup process.py &

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜