Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-02-2011, 01:14 AM   #1
LQ Newbie
Registered: Jun 2011
Posts: 22

Rep: Reputation: Disabled
send msg to predefined ip address when linux server shutdown or Reboot

Hi All,

I need to know how to send message (or execute script ) when the linux machine shutdown or reboot stage.

Actually I want to start a backup linux machine when main server shutdown or Reboot.

simply, how we can run script while init 0 OR init 6 command

Old 08-02-2011, 02:00 AM   #2
Senior Member
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,275

Rep: Reputation: 148Reputation: 148
If main server down then the backup server have to handle the job, is that you want? Umm.. try with Linux high availability heartbeat.
Old 08-02-2011, 02:44 AM   #3
Registered: Jan 2008
Distribution: Debian6 , Centos 6,Ubuntu 11.04
Posts: 57

Rep: Reputation: 2
Try to add script to run levels 0 and 6 .Their scripts lays in /etc/rc6.d and /etc/rc0.d
Copy and existing script and modify it for your work.Each init level init process runs these scripts
Old 08-02-2011, 06:40 PM   #4
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,501

Rep: Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411
If the primary goes down in a controlled manner, then intercepting the appropriate scripts will work. If it's uncontrolled, a heartbeat or similar tool will be reqd.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to shutdown/reboot server, no shutdown process running dctw Linux - Server 5 03-31-2010 05:46 AM
[FYI] "last -f <old wtmp> -x reboot shutdown" incorrect for last reboot and shutdown catkin Linux - General 1 03-25-2010 11:52 PM
[SOLVED] first file which is executed when we reboot or shutdown Linux server vikas027 Linux - General 13 08-22-2009 06:14 AM
Postfix - how to set the IP address used to send mail on a multi-IP server. h00chman Linux - Server 5 04-20-2009 04:33 PM
Server does'nt send mail until shutdown and LAN can't send or receive. Wolfy Linux - Networking 0 08-02-2004 07:31 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:53 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration