• Home
  • About
  • Archives
Skip to content

Pario TechnoBlob

A chronological documentation test project, nothing serious, really!

  • Home
  • About
  • Archives

Restart dead daemon automatically

Posted on 18. February 200819. February 2008 by Hans-Henry Jakobsen

This is a simple bash script to restart a dead daemon, in this example I’ll use apache

#!/bin/bash

# Automatically restart httpd if it dies
netstat -ln | grep ":80 " | wc -l | awk '{if ($1 == 0) system("/etc/init.d/httpd restart") }'

Share this:

  • Twitter
  • Facebook
Posted in: Linux, ScriptingTagged: bash

Post navigation

Previous: Disable ZIP file handling in Windows XP
Next: mysql_secure_installation — Improve MySQL Installation Security
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Search

Apache apt-get awk backup basename bash CentOS convert csv Database dd Debian esxi5 Etch EXIF Fedora find Gentoo grep howto html imagemagick iptables iso jhead JPG mount MySQL Nikon nmap perl PHP Postfix RedHat rename rhel5 sed sftp SMTP sort ssh Ubuntu VMware Wordpress Zimbra

  • Backup
  • Linux
  • Misc
  • Network
  • Photo etc
  • Scripting
  • Security
  • Virtualization
  • Web
  • Windows
Resume X WordPress Theme by Wp Theme Space