Find the answer to your Linux question:
Results 1 to 4 of 4
Hi there, I just created a utility program using Java. This utility program notifies me via email when a significant event has occurred with a message something like: Server has ...
  1. #1
    Just Joined!
    Join Date
    Jun 2006
    Posts
    7

    where is shutdown script

    Hi there,

    I just created a utility program using Java. This utility program notifies me via email when a significant event has occurred with a message something like:

    Server has started. Systems operational.

    Date: Sat Jul 01 10:03:40 ADT 2006
    I call the program MailAlert. It allows you to define up to six messages and can be called simply with a command like: alert message1

    alert is a shell script that you put in the /etc/rc.d/init.d directory and it points to a shell script that exists in the directory where I put the MailAlert program: /usr/local/alert/alert.sh

    So, if I want to be alerted when the server has just finished booting, in the /etc/profile script I add this command: alert message1

    Now, what I would like to know is, what is an appropriate script to use for when the server is about to shut down? In that script I would enter the command: alert message2

    message2 says: "Server is shutting down"

    please advise,

    Alan

  2. #2
    Linux User
    Join Date
    Jun 2006
    Posts
    311
    Hi ashiers,
    Now, what I would like to know is, what is an appropriate script to use for when the server is about to shut down?
    You can use /etc/rc.d/rc6.d/S01reboot for doing that.

    With Regards,
    Thinker

  3. #3
    Just Joined!
    Join Date
    Jun 2006
    Posts
    7
    Quote Originally Posted by Thinker
    You can use /etc/rc.d/rc6.d/S01reboot for doing that.
    Ok, I tried that and from the comments at the top of the script it looks like the appropriate place to put the command: alert message2

    Problem is, when I shut down the server the screen says:

    alert command not found

    Why would that be? How do I fix it?

    Alan

  4. #4
    Linux User
    Join Date
    Jun 2006
    Posts
    311
    Hi ashiers,
    Put the executable file, alert, in /usr/bin or in S01reboot point to the script alert.sh properly.

    With Regards,
    Thinker

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...