Knowledgebase

Portal Home > Knowledgebase > Articles Database > bash - running multiple processes


bash - running multiple processes




Posted by ti_nhatrang, 07-13-2012, 09:29 PM
Hello, I created a bash script running fine with 3 concurrent sessions. however, when I try to execute it again, it just telling me that the job is DONE. but if I clone the bash script to another name/file then it will work. What am I missing? Please help and thank you in advance.

Posted by ti_nhatrang, 07-13-2012, 09:30 PM
I'm using: nohup sh bash.sh 0 2>/dev/null &

Posted by MattF, 07-13-2012, 10:16 PM
How are you backgrounding the process, with & ? What are you trying to do? daemonize something? Are you on shared hosting? Theres nothing limiting bash number of background jobs, but there could be rlimit restriction on number of user process being invoked at play. What does ulimit -a show?

Posted by ti_nhatrang, 07-13-2012, 11:34 PM
here's what i have: [root@iof275 files]# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 266240 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) unlimited virtual memory (kbytes, -v) unlimited file locks (-x) unlimited after doing ulimit -c unlimited, i was able to run about 5 processes. Im just running mysql backups, tarring, ftping , etc...

Posted by ti_nhatrang, 07-13-2012, 11:48 PM
seems like it keeps going back to the original settings - i tried turning of selinux as well

Posted by JustinAY, 07-14-2012, 01:16 AM
Can you paste the output of what's happening here? I'm not sure what you mean by 'executing again' as it's already running. When you say you change the filename and then execute again, it makes me think you mean you're backgrounding a script then running the same script again like this, but I didn't have any issues: justin@sc00by:~$ sh test 2>/dev/null & [1] 27852 justin@sc00by:~$ sh test 2>/dev/null & [2] 27854 justin@sc00by:~$ jobs [1]- Running sh test 2> /dev/null & [2]+ Running sh test 2> /dev/null & justin@sc00by:~$

Posted by ti_nhatrang, 07-14-2012, 08:56 PM
yeah, i tried doing as well... looks like doing a yum -y upgrade helped....



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Redirect using NAT (Views: 558)
What size of server? (Views: 575)


Language:

Contact us