LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   send msg to predefined ip address when linux server shutdown or Reboot (https://www.linuxquestions.org/questions/linux-newbie-8/send-msg-to-predefined-ip-address-when-linux-server-shutdown-or-reboot-895017/)

hk_centos 08-02-2011 01:14 AM

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

kirukan 08-02-2011 02:00 AM

If main server down then the backup server have to handle the job, is that you want? Umm.. try with Linux high availability heartbeat.

ibaydan 08-02-2011 02:44 AM

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

chrism01 08-02-2011 06:40 PM

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.


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