Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I run a script manually like/usr/lib/ 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/ -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 Jan 29 '10 at 7:45

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

This should be moved to – Matt Huggins Jan 29 '10 at 6:19
up vote 1 down vote accepted

you can use pidof to get pid of process

share|improve this answer

try this

while true
 pidof openoffice 1>/dev/null
 if [ $? -eq "1" ];then
  /usr/lib/ &
 sleep 600
share|improve this answer

Your Answer


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.