LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   AH00095 error stopping httpd (https://www.linuxquestions.org/questions/slackware-14/ah00095-error-stopping-httpd-4175625476/)

andrixnet 03-13-2018 04:41 AM

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)

bathory 03-13-2018 05:21 AM

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

andrixnet 03-14-2018 01:48 AM

@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.

koloth 03-14-2018 04:33 AM

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...

andrixnet 03-14-2018 05:54 AM

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).

bathory 03-14-2018 07:16 AM

Quote:

Originally Posted by andrixnet (Post 5830792)
@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?

kjhambrick 03-14-2018 11:36 AM

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



All times are GMT -5. The time now is 05:13 AM.