I'm trying to run a one script file in mesos in background by using nohup command trying, but unfortunately the problem is the script executing successfully but the same scripts spanning as multiple jobs and running all jobs in background.
How can I handle the jobs with out spanning multi jobs, restrict a single jobs after scaling the application in marathon.
**marathon_sample.json**
{
"id": "/dps/sample",
"cmd": "nohup sh /tmp/marathon_test/marathon_sample.sh & >> /tmp/marathon_test/marathon_test.log",
"cpus": 0.1,
"mem": 512,
"disk": 1,
"instances": 0,
"container": null,
"constraints": [
[
"hostname",
"LIKE",
"(lltws0gbeot.sdi.corp.bankofamerica.com)"
]
],
"portDefinitions": [
{
"port": 0,
"protocol": "tcp",
"name": null,
"labels": null
}
]
}
**marathon_sample.sh**
#! /bin/sh
while [ true ] ;
do
echo 'Hello Marathon test application'
sleep 5 ;
done
Can any one help me to run "marathon_sample.sh" in mesos as a background job.