Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

named.restart script 1

Status
Not open for further replies.

menace212

Programmer
Jul 11, 2003
144
US
Does anyone have a sample script for restarting named automatically. Getting the PID, killing it and then restarting /usr/sbin/named???
 
Normally, a SIGHUP signal force named to reread this configuration file and reload the database.
Try something like this:
Code:
pid=`ps -e | awk '$NF=="named"{print $1}'`
[ -n "$pid" ] && kill -1 $pid

Hope This Help
PH.
 
Depending on your OS it could be pretty easy:

AIX: "stopsrc -s named;startsrc -s named"
Linux: "service named restart"

In other cases using run level entries it can be done using the entry in /etc/rc.d/init.d/ (or wherever your init.d dir lives) : "named restart"

IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
MS Certified Windblows Rebooter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top