3

I run a script manually like/usr/lib/openoffice.org/program/soffice and when I run

:ps -ef|grep openoffice

I get the following,

root 700 1 0 10:45 ? 00:00:00 /bin/sh /usr/lib/openoffice.org/program/soffice -calc

My question is how to check whether this script is running or not (It can be checked every 10 minutes) and how to make it as a service. (I don't have root access to put this in rc.local file or somewhere else).

  • 1
    This should be moved to superuser.com. – Matt Huggins Jan 29 '10 at 6:19
1

you can use pidof to get pid of process

0

try this

while true
do
 pidof openoffice 1>/dev/null
 if [ $? -eq "1" ];then
  /usr/lib/openoffice.org/program/soffice &
 fi
 sleep 600
done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.