LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Shell Script running in another shell script and then exit (https://www.linuxquestions.org/questions/linux-general-1/shell-script-running-in-another-shell-script-and-then-exit-903317/)

dreamervlk 09-16-2011 03:52 AM

Shell Script running in another shell script and then exit
 
Hi,

I have a shell script. And i want use last line script then exit, but when i run this script, its only waiting and then i must use ctrl+z keys. when i look ps -f CronClean.sh and /usr/local/etc/rc.d/proxy_monitor.sh start
running...

#CronClean.sh
ps -f | grep "proxy_monitor.sh" | awk '{print $1}' | xargs kill -9
/usr/local/etc/rc.d/squid.sh stop
rm -rf /var/squid/cache/
mkdir -p /var/squid/cache/
chown proxy:proxy /var/squid/cache/
chmod 777 /var/squid/cache/
squid -z
/usr/local/etc/rc.d/squid.sh start
sh /usr/local/etc/rc.d/proxy_monitor.sh start


Volkan

mirni 09-16-2011 04:41 AM

Can you post the contents of /usr/local/etc/rc.d/proxy_monitor.sh? My guess would be that it hangs there...

dreamervlk 09-16-2011 04:53 AM

http://code.google.com/p/pfsense-cac...nitor.sh?r=251

you can see on that link

dreamervlk 09-16-2011 06:40 AM

Ok i did it ...


i used to nohup command and it works

nohup sh /usr/local/etc/rc.d/proxy_monitor.sh start &


All times are GMT -5. The time now is 05:51 PM.