up vote 2 down vote favorite
share [g+] share [fb]

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).

link|improve this question

80% accept rate
1  
This should be moved to superuser.com. – Matt Huggins Jan 29 '10 at 6:19
feedback

migrated from stackoverflow.com Jan 29 '10 at 7:45

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 1 down vote accepted

you can use pidof to get pid of process

link|improve this answer
feedback

try this

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

Your Answer

 
or
required, but never shown

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