Pregunta

So I'm attempting to make a start file which launches several screens each with their respective script. Looks a bit like:

cd /home/foo/
screen -dmS foo bash -c '/run.sh'
echo Started Foo

run.sh:

#!/bin/bash
while true
do
    java -Xmx1024M -XX:MaxPermSize=256M -server -jar foo.jar -o true
    sleep 5
done;

Now if I do screen -ls right after I run it, the screen shows up. However if I check a second later, the screens gone. Am I doing something wrong or is this the typical behavior?

¿Fue útil?

Solución

I had to add sh to the start of the command because I didn't make it executable.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top