Commit 502218c0 authored by Lorenzo Pivetta's avatar Lorenzo Pivetta

fix pid search; update ulimit set

parent b4c4ff4d
......@@ -24,7 +24,7 @@ export PATH=/bin:/sbin:/usr/sbin:/usr/bin
startsrv()
{
pid=`ps -ef|awk '$8 == search1 && $9 == search2 {print $2}' search1=${SRV} search2=${INSTANCE}`
pid=`ps -ef|awk '$8 ~ search1 && $9 == search2 {print $2}' search1=${SRV} search2=${INSTANCE}`
if [ $pid ]; then
echo "${SRV} already running"
else
......@@ -33,15 +33,15 @@ startsrv()
echo "ERROR: ${SRV} should run as user '${USER}'"
return
fi
ulimit -r ${RTPRIO} -s ${STACKSIZE}
echo -n "Starting ${SRV}... "
if [ ${uid} -eq ${ROOT} ]; then
ulimit -r ${RTPRIO} -s ${STACKSIZE}
su ${USER} -p -c "${SRV} ${INSTANCE} 1>${LOGFILE} 2>&1 &"
else
${SRV} ${INSTANCE} 1>${LOGFILE} 2>&1 &
fi
sleep 2
pid=`ps -ef|awk '$8 == search1 && $9 == search2 {print $2}' search1=${SRV} search2=${INSTANCE}`
pid=`ps -ef|awk '$8 ~ search1 && $9 == search2 {print $2}' search1=${SRV} search2=${INSTANCE}`
if [ ${pid} ]; then
echo "done"
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment