Hello, I'd like to create a small application which would monitor one important log on our Solaris 10 environment.
So far, I createad a script which does the monitoring, and I though through nohup it would become one of the permanent running processes.
>nohup monitor.sh &
[1] 3139
> more monitor.sh
#!/bin/ksh
LOGDIR=/application/logs
if [ ! -f ${LOGDIR}/extracted_errors.log ]
then touch ${LOGDIR}/extracted_errors.log
fi
tail -f application_common.log |
while read -r line
do
echo ${line} | grep 'ALERT' | grep 'first_application' | grep 'SourceError' >> /dev/null
if [ $? = 0 ]
then
echo "Logged at:"`date '+%h %d %H:%M:%S'`"1st Application failure" >> ${LOGDIR}/extracted_errors.log
echo ${line} | grep 'ALERT' | grep 'second_application' | grep 'SourceError' >> /dev/null
if [ $? = 0 ]
then
echo "Logged at:"`date '+%h %d %H:%M:%S'`"2nd Application failure" >> ${LOGDIR}/extracted_errors.log
fi
done
Now, my problem is, it runs and does what I want, but how can I stop it?
When I want to exit the system (and leave the monitoring script running), it's not allowing me to leave. The only way how to leave, is to kill the tail -f process for other terminal connection

What am I doing wrong?
Any help appreciated...
Thank you in advance.
Martin