views:

436

answers:

3

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
DAEMON=/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!

A: 

try launching with nohup process.py &

kibitzer
A: 

Could it be the space after the equal sign?

SOCKET=/home/piros/amule_scripts/aMuleSocket/aMuleSocket.py
Dennis Williamson
+1  A: 

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.

Greg Bacon
This did it!! Thanks
PirosB3