{"id":210,"date":"2007-08-29T16:52:54","date_gmt":"2007-08-29T23:52:54","guid":{"rendered":"http:\/\/www.laurenwood.org\/anyway\/archives\/2007\/08\/29\/apache-and-logrotate\/"},"modified":"2007-08-29T16:52:54","modified_gmt":"2007-08-29T23:52:54","slug":"apache-and-logrotate","status":"publish","type":"post","link":"https:\/\/www.laurenwood.org\/anyway\/2007\/08\/apache-and-logrotate\/","title":{"rendered":"Apache and Logrotate"},"content":{"rendered":"<p>I use apache to serve a few sites from the fire\u00adwall box in the base\u00adment and for some reas\u00adon it kept dying on a reg\u00adu\u00adlar basis. This star\u00adted fairly recently, some time after I set up sep\u00adar\u00adate access log files for each of the&nbsp;sites.<\/p>\n<p>The error logs showed entries like&nbsp;<\/p>\n<pre>[Sun Jun 10 06:28:03 2007] [warn] child process 16516 still \ndid not exit, sending a SIGTERM<\/pre>\n<p>which seemed bizarre and wer\u00aden\u2019t being spawned by any\u00adthing obvi\u00adous in the access logs. I even\u00adtu\u00adally remembered that I had set up log rota\u00adtion for each of the vir\u00adtu\u00adal hosts, and went search\u00ading through the error logs to see if it was related. Sure enough, the shut-down was hap\u00adpen\u00ading at the same time, and so the log rota\u00adtion was likely to be related to the cause. But what could be the real cause? Surely not just rotat\u00ading&nbsp;logs\u2026<\/p>\n<p>A bit of pok\u00ading around the web found that oth\u00ader people have had this prob\u00adlem. I went down a bunch of dead ends (vir\u00adtu\u00adal hosts? <code>apache2ctl restart<\/code> vs <code>apache2ctl start<\/code>?) and even\u00adtu\u00adally just turned error report\u00ading up to the max\u00adim\u00adum. The next week, after the serv\u00ader went dead again, I found the fol\u00adlow\u00ading email in my sysad\u00admin&nbsp;inbox.<\/p>\n<pre>\n\/etc\/cron.daily\/logrotate:\n(98)Address already in use: make_sock: could not bind to \naddress 0.0.0.0:80\nno listening sockets available, shutting down\nUnable to open logs\nerror: error running shared postrotate script for \n\/var\/log\/apache2\/*.log\nrun-parts: \/etc\/cron.daily\/logrotate exited with return \ncode 1<\/pre>\n<p>Hunt\u00ading around more on the web, I found a recom\u00admend\u00ada\u00adtion to <a href=\"http:\/\/forums.starwebtechnologies.com\/thread7.html\">expli\u00adcitly set the <span class=\"caps\">TMPDIR<\/span> envir\u00adon\u00adment vari\u00adable<\/a> before run\u00adning <code>logrotate<\/code>. Apache has now been up for a few weeks without fall\u00ading over, prob\u00adlem solved! I\u2019m still not sure why this only star\u00adted to hap\u00adpen after set\u00adting up sep\u00adar\u00adate log files for the sep\u00adar\u00adate vir\u00adtu\u00adal hosts, or even if that was more than a prox\u00adim\u00adate coincidence.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I use apache to serve a few sites from the fire\u00adwall box in the base\u00adment and for some reas\u00adon it kept dying on a reg\u00adu\u00adlar basis. This star\u00adted fairly recently, some time after I set up sep\u00adar\u00adate access log files for each of the&nbsp;sites. The error logs showed entries like&nbsp; [Sun Jun 10 06:28:03 2007] \u2026 <a href=\"https:\/\/www.laurenwood.org\/anyway\/2007\/08\/apache-and-logrotate\/\" class=\"more-link\">Con\u00adtin\u00adue read\u00ading<span class=\"screen-reader-text\"> \u201cApache and Logrotate\u201d<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-210","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/posts\/210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/comments?post=210"}],"version-history":[{"count":0,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/posts\/210\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/media?parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/categories?post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/tags?post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}