Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 04-18-2004, 03:58 AM   #1
LQ Newbie
Registered: Jan 2004
Posts: 5

Rep: Reputation: 0
Automatic shutdown using ping

Hi all,

I have set up a Linux server to serve various devices (i.e. MP3 playback in the living room). The server automatically starts up using wake on LAN.

I would like the server to shutdown automatically as well. I think about a script using "ping" to check if any of the served devices is up (using a list of IP addresses) and shutting down when none is available for 15 minutes.

Did anybody already do this or has another solution and can provide a matching script?
Old 04-20-2004, 08:46 AM   #2
Registered: Apr 2001
Location: Bremen, Germany
Distribution: Debian
Posts: 303

Rep: Reputation: 30
Not sure if ping is the right solution. A lot of services use icmp to check availability of a host so this could result in the server going down randomly. I once read a LJ article on port knocking. The idea is to parse the firewall logs for a certain knock sequence and then take appropriate action. Like opening up a port or something. This sure can be expanded to call shutdown on receiving a predefined shutdown knock sequence.

Here's the article:

oops. I guess I misread your question as well. The keyword being automatically shut down the server... Yeah, then the port knocking thing is not such a good idea.

Last edited by demian; 04-20-2004 at 09:13 AM.
Old 04-20-2004, 09:01 AM   #3
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 345

Rep: Reputation: 31
wrong - i misunderstood what u asked

Last edited by JJX; 04-20-2004 at 09:02 AM.
Old 04-20-2004, 10:37 AM   #4
Registered: Apr 2004
Location: Arlington, TX
Distribution: Fedora Core 4 64bit
Posts: 95

Rep: Reputation: 15
Does your distro and hardware support ACPI? You could just use that and set the monitor, HD, and system to shut down after 15 min inactivity.
Old 04-24-2004, 04:59 AM   #5
LQ Newbie
Registered: Jan 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for all the replies.

I do not think ACPI will do the job since there is no way to define "system activity" as "is the server serving any clients". As far as I know it rather reacts on mouse and keyboard activity. I can use it the stop the HD when it is not accessed and thereby saving some energy and reducing noise, so thanks for that idea.

What I am looking for is completely shutting down the system when it is not needed. And for my purpose not needed means that no potential clients are up and running. That's why I thought ping might be the solution.


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
automatic shutdown via 12V relay MrSmee Linux - Hardware 4 05-04-2004 09:52 AM
automatic shutdown in Mandrake 9.2 lu543285 Mandriva 1 02-13-2004 08:10 AM
automatic shutdown in Mandrake 9.2 lu543285 Linux - Hardware 1 02-13-2004 07:35 AM
Automatic shutdown NetScripter Linux - General 1 10-17-2002 02:45 PM
automatic ping mandrake_linux Linux - Networking 2 03-26-2001 09:08 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:18 PM.

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