LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-13-2018, 04:41 AM   #1
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 110

Rep: Reputation: Disabled
AH00095 error stopping httpd


On slackware-14.2 I iget the following in error_log when stopping apache:

[Tue Mar 13 11:35:55.001935 2018] [core:error] [pid 1307:tid 140096227051392] (2)No such file or directory: AH00095: failed to remove PID file /var/run/httpd.pid
[Tue Mar 13 11:35:55.001982 2018] [mpm_event:notice] [pid 1307:tid 140096227051392] AH00491: caught SIGTERM, shutting down


The file /var/run/httpd.pid exists while httpd is running.
From what I've been able to find online so far (and my own intuition), this is a minor error that can be safely ignored.
However, it still bothers me.

I'm running Apache/2.4.29 and PHP 7.1.14 (if it were to have any influence)
 
Old 03-13-2018, 05:21 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,214

Rep: Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682
Hi,
Quote:
[Tue Mar 13 11:35:55.001935 2018] [core:error] [pid 1307:tid 140096227051392] (2)No such file or directory: AH00095: failed to remove PID file /var/run/httpd.pid
[Tue Mar 13 11:35:55.001982 2018] [mpm_event:notice] [pid 1307:tid 140096227051392] AH00491: caught SIGTERM, shutting down
This happens when you're trying to restart apache while it's not running.
If it's stopped, you can use the "start" option instead of "restart":
Code:
/etc/rc.d/rc.httpd start
 
Old 03-14-2018, 01:48 AM   #3
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 110

Original Poster
Rep: Reputation: Disabled
@bathory: it happens when httpd IS running and I am issueing /etc/rc.d/rc.httpd stop
(I am running this command for specific reasons, one of which being that "restart" does not always suffice in some contexts).

The even stranger thing is that the error happens on several systems with identical configuration, but does not happen on a few others with the same configuration, yet \I haven't been able to discovery any reasons why.
 
Old 03-14-2018, 04:33 AM   #4
koloth
Member
 
Registered: Jun 2004
Location: Athens, Greece
Distribution: Slack@Home - RHEL@Work
Posts: 135

Rep: Reputation: 25
Hi,
can you post the output of :

Quote:
la -la /var/run/httpd.pid
Together with the username httpd is using,

It could be a user rights issue here...
 
Old 03-14-2018, 05:54 AM   #5
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 110

Original Poster
Rep: Reputation: Disabled
ls -la /var/run/httpd.pid
-rw-r--r-- 1 root root 6 Mar 14 12:47 /var/run/httpd.pid

httpd is using user www and group www.

ls -l /var
drwxr-xr-x 12 root root 4096 Mar 14 12:47 run/

These are the same permissions as used on other slackware-14.1 systems with same setup (just different versions according to distro).
 
Old 03-14-2018, 07:16 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,214

Rep: Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682
Quote:
Originally Posted by andrixnet View Post
@bathory: it happens when httpd IS running and I am issueing /etc/rc.d/rc.httpd stop
(I am running this command for specific reasons, one of which being that "restart" does not always suffice in some contexts).

The even stranger thing is that the error happens on several systems with identical configuration, but does not happen on a few others with the same configuration, yet \I haven't been able to discovery any reasons why.
D'oh, it looks like a glitch in the startup file. I'm not running the official apache package from Slackware, but according to the following snippet:
Quote:
<snip>
/usr/sbin/apachectl -k stop
killall httpd
# Remove both old and new .pid locations:
rm -f /var/run/httpd.pid /var/run/httpd/httpd.pid
<snip>
The startup script first stops/kills httpd and the tries to remove the pid file that is already removed by the previous operation. Maybe the -f switch is not honored?

Last edited by bathory; 03-14-2018 at 08:03 AM.
 
1 members found this post helpful.
Old 03-14-2018, 11:36 AM   #7
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,336

Rep: Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722
interesting issue andrixnet.

Despite what I read in `man apachectl`, looking at the ACMD Variable in the /usr/sbin/apachectl script, it sure looks to me like the -k option in /etc/rc.d/rc.httpd is undesired ?

Do you still get the errors in the log if you test /etc/rc.d/rc.httpd without any -k flags ?

HTH

-- kjh

Removed the -k flags from /etc/rc.d/rc.httpd:

Code:
<<snipped from /etc/rc.d/rc.httpd>> 

 For information on these options, "man apachectl".

case "$1" in
  'start')
    /usr/sbin/apachectl start             # removed -k 
  ;;
  'stop')
    /usr/sbin/apachectl stop              # removed -k
    killall httpd
    # Remove both old and new .pid locations:
    rm -f /var/run/httpd.pid /var/run/httpd/httpd.pid
  ;;
  'force-restart')
    # Because sometimes restarting through apachectl just doesn't do the trick...
    /usr/sbin/apachectl stop              # removed -k
    killall httpd
    # Remove both old and new .pid locations:
    rm -f /var/run/httpd.pid /var/run/httpd/httpd.pid
    /usr/sbin/apachectl start             # removed -k
  ;;
  'restart')
    /usr/sbin/apachectl restart           # removed -k
  ;;
  'graceful')
    /usr/sbin/apachectl graceful          # removed -k
  ;;
  'graceful-stop')
    /usr/sbin/apachectl graceful-stop     # removed -k
  ;;
  *)
    echo "Usage: $0 {start|stop|restart|graceful|graceful-stop}"
  ;;
esac
 
  


Reply

Tags
httpd


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
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
Failed to start apache :Starting httpd: Syntax error on line 1027 of /etc/httpd/conf/ payjoe Linux - Newbie 3 09-21-2007 07:24 AM
Starting httpd: /usr/sbin/httpd: symbol lookup error: /usr/local/lib/libaprutil-0.so. bijuhpd Linux - Newbie 1 10-30-2005 05:07 PM
stopping httpd bato Slackware 2 02-18-2005 04:47 PM
Starting/stopping httpd bughunter Linux - Newbie 3 10-20-2001 10:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:40 PM.

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