LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 08-02-2011, 01:14 AM   #1
hk_centos
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

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

Rep: Reputation: 132Reputation: 132
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
ibaydan
Member
 
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
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
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.
 
  


Reply


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


All times are GMT -5. The time now is 09:17 PM.

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