Linux – Hibernate a CentOS server when inactive

acpicentoshibernatelinux

I'm trying to get a CentOS 5.4 server to hibernate when the system has been inactive for a while. By inactive I mean there are no incoming network connections.

I can get the system to hibernate and also make it wake-up over the network. What I need to know is how to configure the system to monitor the network traffic and go into hibernation after a while, say 2 hours.

Best Answer

If it is a server, then which services needs to be up? If you serve HTTP only and need SSH also, just monitor HTTP, HTTPS and SSH traffic and if it is idle for more than X minutes hibernate it. You can use tshark to check this.