Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Linux script to restart process running out of inittab

Posted on 2006-07-13
6
Medium Priority
?
2,076 Views
Last Modified: 2008-01-09
Can someone help me with writing a script to restart a process running out of the inittab.
Any links or suggestions would be great.



Thank you.
0
Comment
Question by:cbones
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 24

Expert Comment

by:slyong
ID: 17105737
Hi cbones,

Could you let us know what is the process that you want to restart and the relevant entry in the inittab?
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17106196
run the application from inittab as following
c1:2345:respawn:/path/to/application

then just kill the application if You want to restat it (init will respawn it)
killall application
0
 

Author Comment

by:cbones
ID: 17159224
One of our software venders has a java process running in the inittab. They can't seem to figure out why it crashes so often.  The only way to get it running again is to kill the process manually and restart it.  I wanted to have a script run every night to stop the process and then restart it.  This way there would be no issues with the process stopping.

It seems when it is running for a few days it hangs up.  I believe the restart would help stop this issue.


Thanks.

0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 24

Accepted Solution

by:
slyong earned 500 total points
ID: 17159250
use crontab to schedule the restart of the application (shutdown and startup).  Login as the user you can stop and start the application.  Then on the command line type:

$ crontab -e
10 0 * * * /path/to/script/restartscript.sh

The above will run restartscript.sh as 12:10am every night.  In your restartscript.sh you would need to issue the command to kill the process and restart it:

#!/bin/bash
/usr/bin/killall processname
/path/to/applicationstartup

**Note that in the restartscript.sh you have to use the fullpath.

0
 

Author Comment

by:cbones
ID: 17161394
Thank you for all your help.  I am going to give it a shot.


Thank you.
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17162496
What is has to do with init/inittab?
But I guess it works...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question