LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-14-2005, 05:56 AM   #1
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Rep: Reputation: 30
Apache keeps restarting with DaemonTools


I've installed DaemonTools, created /service/apache

and wrote a very simple run with the lines:

#!/bin/sh
exec /path/to/httpd/binary/httpd

the line "exec /path/httpd" works from the command line and I get httpd in the background when I check with ps and also port 80 is bound to with netstat.

However, when I use this run script with daemontools service, the process restarts every second such that it never appears in the ps list. It's pid keeps changing indicating a constantly respawning process.

Any idea why this is?
 
Old 11-14-2005, 07:31 AM   #2
xrtc
LQ Newbie
 
Registered: Sep 2005
Posts: 28

Rep: Reputation: 15
why u try to execute apache with DeamonTools??

try the simple httpd &


or if u still have probs try with screen utility


screen -AmdS apache /path to apache/httpd

if u need to start the apache at boot just put these one of these lines into ur startup files (rc.local or boot.local etc.
 
Old 11-14-2005, 08:58 AM   #3
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Original Poster
Rep: Reputation: 30
I want it to restart apache if it falls over

otherwise I could just use the init.d script...
 
Old 11-14-2005, 09:55 AM   #4
xrtc
LQ Newbie
 
Registered: Sep 2005
Posts: 28

Rep: Reputation: 15
*/5 * * * * /usr/local/bin/iptraffic 1> /dev/null 2> /dev/null


expample from my cron
the cron check every 5mins if its runnin the iptraf... if not it restart the service
 
Old 11-14-2005, 10:51 AM   #5
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Original Poster
Rep: Reputation: 30
did I mention this is a mission critical server?

daemon-tools restarts within 5 seconds if anything goes wrong. Also, I have added extra security to this server which kills any process that is compromised, So if something gets killed in order to avoid compromise, I want it to come straight back up.
 
  


Reply


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
how to make a simple code for just restarting Apache via a Cron job hsa Programming 1 08-22-2005 04:15 AM
Restarting Apache Virtual Hosts Individually libsys Linux - Software 1 04-12-2005 04:46 AM
running httpd.conf without restarting apache mpower Linux - Newbie 3 03-16-2005 05:20 PM
Starting and Restarting the Apache service. johann519 Fedora 6 02-05-2004 11:00 PM
restarting Apache Xiled Linux - Networking 7 10-09-2001 10:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration