Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

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

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

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

2 Answers

up vote 1 down vote accepted

you can use pidof to get pid of process

share|improve this answer
add comment

try this

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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