apache-httpd rc script not working properly

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

apache-httpd rc script not working properly

Michael Lechtermann-3
Hi,

the current apache2 rc.d script isn’t working properly as it is. The script doesn’t detect if the process was started successfully and can neither stop, reload or even check it. The following patch fixes it for me:

--- apache2.rc.orig     Mon Jun 20 21:07:37 2016
+++ apache2.rc  Mon Jun 20 21:11:56 2016
@@ -6,4 +6,10 @@

. /etc/rc.d/rc.subr

+pexp="httpd2:.*${daemon}"
+
+rc_reload() {
+       pkill -HUP -oxf "${pexp}"
+}
+
rc_cmd $1



Best regards,
Michael
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: apache-httpd rc script not working properly

Antoine Jacoutot-7
On Mon, Jun 20, 2016 at 11:16:53PM +0200, Michael Lechtermann wrote:
> Hi,
>
> the current apache2 rc.d script isn’t working properly as it is. The script doesn’t detect if the process was started successfully and can neither stop, reload or even check it. The following patch fixes it for me:

Thanks, I'll have a look at it.

> --- apache2.rc.orig     Mon Jun 20 21:07:37 2016
> +++ apache2.rc  Mon Jun 20 21:11:56 2016
> @@ -6,4 +6,10 @@
>
> . /etc/rc.d/rc.subr
>
> +pexp="httpd2:.*${daemon}"
> +
> +rc_reload() {
> +       pkill -HUP -oxf "${pexp}"
> +}
> +
> rc_cmd $1
>
>
>
> Best regards,
> Michael
>

--
Antoine

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: apache-httpd rc script not working properly

Antoine Jacoutot-7
On Tue, Jun 21, 2016 at 12:49:49AM +0200, Antoine Jacoutot wrote:
> On Mon, Jun 20, 2016 at 11:16:53PM +0200, Michael Lechtermann wrote:
> > Hi,
> >
> > the current apache2 rc.d script isn’t working properly as it is. The script doesn’t detect if the process was started successfully and can neither stop, reload or even check it. The following patch fixes it for me:
>
> Thanks, I'll have a look at it.

Sorry but I cannot reproduce your issue with a default configuration.
So you'll have to provide us with more info.


>
> > --- apache2.rc.orig     Mon Jun 20 21:07:37 2016
> > +++ apache2.rc  Mon Jun 20 21:11:56 2016
> > @@ -6,4 +6,10 @@
> >
> > . /etc/rc.d/rc.subr
> >
> > +pexp="httpd2:.*${daemon}"
> > +
> > +rc_reload() {
> > +       pkill -HUP -oxf "${pexp}"
> > +}
> > +
> > rc_cmd $1
> >
> >
> >
> > Best regards,
> > Michael
> >
>
> --
> Antoine

--
Antoine

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: apache-httpd rc script not working properly

Michael Lechtermann-3
Hi,

> On 21Juni, 2016, at 17:03, Antoine Jacoutot <[hidden email]> wrote:
>
> Sorry but I cannot reproduce your issue with a default configuration.
> So you'll have to provide us with more info.

thanks for checking, this is the behavior I get with 5.9:

# time /etc/rc.d/apache2 start
apache2(failed)
    0m35.09s real     0m00.27s user     0m02.40s system
[…starts OK, but fails to check, times out…]

# ps ax | grep [h]ttpd2
14568 ??  Ss      0:00.38 httpd2: /usr/local/sbin/httpd2
19759 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
 7983 ??  S       0:00.14 httpd2: /usr/local/sbin/httpd2
 8262 ??  S       0:00.06 httpd2: /usr/local/sbin/httpd2
23839 ??  S       0:00.26 httpd2: /usr/local/sbin/httpd2
24914 ??  S       0:00.11 httpd2: /usr/local/sbin/httpd2
19513 ??  S       0:00.20 httpd2: /usr/local/sbin/httpd2
 3778 ??  S       0:00.25 httpd2: /usr/local/sbin/httpd2
 8778 ??  S       0:00.23 httpd2: /usr/local/sbin/httpd2
17706 ??  S       0:00.13 httpd2: /usr/local/sbin/httpd2
 8920 ??  S       0:00.12 httpd2: /usr/local/sbin/httpd2
21764 ??  S       0:00.18 httpd2: /usr/local/sbin/httpd2
23359 ??  S       0:00.12 httpd2: /usr/local/sbin/httpd2
15642 ??  S       0:00.20 httpd2: /usr/local/sbin/httpd2
32692 ??  S       0:00.18 httpd2: /usr/local/sbin/httpd2
19331 ??  S       0:00.10 httpd2: /usr/local/sbin/httpd2
  348 ??  S       0:00.07 httpd2: /usr/local/sbin/httpd2
 1547 ??  S       0:00.28 httpd2: /usr/local/sbin/httpd2
28917 ??  S       0:00.01 httpd2: /usr/local/sbin/httpd2

# /etc/rc.d/apache2 stop
[…no output…]

# ps ax | grep [h]ttpd2
14568 ??  Ss      0:00.38 httpd2: /usr/local/sbin/httpd2
19759 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
 8262 ??  S       0:00.06 httpd2: /usr/local/sbin/httpd2
19513 ??  S       0:00.21 httpd2: /usr/local/sbin/httpd2
 7983 ??  S       0:00.14 httpd2: /usr/local/sbin/httpd2
23839 ??  S       0:00.26 httpd2: /usr/local/sbin/httpd2
24914 ??  S       0:00.12 httpd2: /usr/local/sbin/httpd2
 3778 ??  S       0:00.33 httpd2: /usr/local/sbin/httpd2
 8778 ??  S       0:00.23 httpd2: /usr/local/sbin/httpd2
 8920 ??  S       0:00.14 httpd2: /usr/local/sbin/httpd2
17706 ??  S       0:00.15 httpd2: /usr/local/sbin/httpd2
21764 ??  S       0:00.18 httpd2: /usr/local/sbin/httpd2
  348 ??  S       0:00.08 httpd2: /usr/local/sbin/httpd2
32692 ??  S       0:00.22 httpd2: /usr/local/sbin/httpd2
23359 ??  S       0:00.13 httpd2: /usr/local/sbin/httpd2
19331 ??  S       0:00.10 httpd2: /usr/local/sbin/httpd2
15642 ??  S       0:00.20 httpd2: /usr/local/sbin/httpd2
 1547 ??  S       0:00.29 httpd2: /usr/local/sbin/httpd2
28917 ??  S       0:00.01 httpd2: /usr/local/sbin/httpd2

# /etc/rc.d/apache2 reload
apache2(failed)

# ps ax | grep [h]ttpd2
14568 ??  Ss      0:00.41 httpd2: /usr/local/sbin/httpd2
19759 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
 8262 ??  S       0:00.07 httpd2: /usr/local/sbin/httpd2
 7983 ??  S       0:00.14 httpd2: /usr/local/sbin/httpd2
24914 ??  S       0:00.12 httpd2: /usr/local/sbin/httpd2
19513 ??  S       0:00.24 httpd2: /usr/local/sbin/httpd2
23839 ??  S       0:00.26 httpd2: /usr/local/sbin/httpd2
 3778 ??  S       0:00.37 httpd2: /usr/local/sbin/httpd2
 8778 ??  S       0:00.23 httpd2: /usr/local/sbin/httpd2
21764 ??  S       0:00.19 httpd2: /usr/local/sbin/httpd2
 8920 ??  S       0:00.15 httpd2: /usr/local/sbin/httpd2
17706 ??  S       0:00.15 httpd2: /usr/local/sbin/httpd2
  348 ??  S       0:00.08 httpd2: /usr/local/sbin/httpd2
15642 ??  S       0:00.20 httpd2: /usr/local/sbin/httpd2
32692 ??  S       0:00.22 httpd2: /usr/local/sbin/httpd2
23359 ??  S       0:00.13 httpd2: /usr/local/sbin/httpd2
19331 ??  S       0:00.10 httpd2: /usr/local/sbin/httpd2
 1547 ??  S       0:00.29 httpd2: /usr/local/sbin/httpd2
28917 ??  S       0:00.03 httpd2: /usr/local/sbin/httpd2

# /etc/rc.d/apache2 check
apache2(failed)

# ps ax | grep [h]ttpd2
14568 ??  Ss      0:00.46 httpd2: /usr/local/sbin/httpd2
19759 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
 8262 ??  S       0:00.08 httpd2: /usr/local/sbin/httpd2
 7983 ??  S       0:00.14 httpd2: /usr/local/sbin/httpd2
24914 ??  S       0:00.13 httpd2: /usr/local/sbin/httpd2
19513 ??  S       0:00.24 httpd2: /usr/local/sbin/httpd2
23839 ??  S       0:00.26 httpd2: /usr/local/sbin/httpd2
 3778 ??  S       0:00.37 httpd2: /usr/local/sbin/httpd2
 8778 ??  S       0:00.23 httpd2: /usr/local/sbin/httpd2
21764 ??  S       0:00.19 httpd2: /usr/local/sbin/httpd2
 8920 ??  S       0:00.15 httpd2: /usr/local/sbin/httpd2
17706 ??  S       0:00.15 httpd2: /usr/local/sbin/httpd2
  348 ??  S       0:00.08 httpd2: /usr/local/sbin/httpd2
15642 ??  S       0:00.21 httpd2: /usr/local/sbin/httpd2
32692 ??  S       0:00.29 httpd2: /usr/local/sbin/httpd2
23359 ??  S       0:00.13 httpd2: /usr/local/sbin/httpd2
19331 ??  S       0:00.10 httpd2: /usr/local/sbin/httpd2
 1547 ??  S       0:00.29 httpd2: /usr/local/sbin/httpd2
28917 ??  S       0:00.03 httpd2: /usr/local/sbin/httpd2


Now with my patched rc file:

# time /etc/rc.d/apache2 start
apache2(ok)
    0m02.10s real     0m00.20s user     0m00.63s system

# ps ax | grep [h]ttpd2
17404 ??  Ss      0:00.25 httpd2: /usr/local/sbin/httpd2
30876 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
23773 ??  S       0:00.18 httpd2: /usr/local/sbin/httpd2
 5264 ??  S       0:00.03 httpd2: /usr/local/sbin/httpd2
27899 ??  S       0:00.04 httpd2: /usr/local/sbin/httpd2
15857 ??  S       0:00.22 httpd2: /usr/local/sbin/httpd2
 3159 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
13055 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
 8073 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
 5056 ??  S       0:00.04 httpd2: /usr/local/sbin/httpd2
14074 ??  S       0:00.03 httpd2: /usr/local/sbin/httpd2
17163 ??  S       0:00.06 httpd2: /usr/local/sbin/httpd2
 6265 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
18026 ??  S       0:00.05 httpd2: /usr/local/sbin/httpd2
32112 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
23745 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
 5031 ??  S       0:00.07 httpd2: /usr/local/sbin/httpd2

# /etc/rc.d/apache2 reload
apache2(ok)

# ps ax | grep [h]ttpd2
17404 ??  Ss      0:00.50 httpd2: /usr/local/sbin/httpd2
25505 ??  S       0:00.01 httpd2: /usr/local/sbin/httpd2
 8207 ??  S       0:00.04 httpd2: /usr/local/sbin/httpd2
21509 ??  S       0:00.03 httpd2: /usr/local/sbin/httpd2
31662 ??  S       0:00.04 httpd2: /usr/local/sbin/httpd2
 5425 ??  S       0:00.03 httpd2: /usr/local/sbin/httpd2
20503 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
31902 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
19648 ??  S       0:00.04 httpd2: /usr/local/sbin/httpd2
23178 ??  S       0:00.06 httpd2: /usr/local/sbin/httpd2
22253 ??  S       0:00.07 httpd2: /usr/local/sbin/httpd2
   10 ??  S       0:00.09 httpd2: /usr/local/sbin/httpd2
 6290 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
13630 ??  S       0:00.05 httpd2: /usr/local/sbin/httpd2
 4570 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
13903 ??  S       0:00.02 httpd2: /usr/local/sbin/httpd2
18365 ??  R       0:00.13 httpd2: /usr/local/sbin/httpd2

# /etc/rc.d/apache2 check
apache2(ok)

# /etc/rc.d/apache2 stop
apache2(ok)

# ps ax | grep [h]ttpd2
[…no output… OK]


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: apache-httpd rc script not working properly

Antoine Jacoutot-7
In reply to this post by Antoine Jacoutot-7
On Tue, Jun 21, 2016 at 12:49:49AM +0200, Antoine Jacoutot wrote:
> On Mon, Jun 20, 2016 at 11:16:53PM +0200, Michael Lechtermann wrote:
> > Hi,
> >
> > the current apache2 rc.d script isn’t working properly as it is. The script doesn’t detect if the process was started successfully and can neither stop, reload or even check it. The following patch fixes it for me:

Should be fixed in current. Thanks for the report.


>
> Thanks, I'll have a look at it.
>
> > --- apache2.rc.orig     Mon Jun 20 21:07:37 2016
> > +++ apache2.rc  Mon Jun 20 21:11:56 2016
> > @@ -6,4 +6,10 @@
> >
> > . /etc/rc.d/rc.subr
> >
> > +pexp="httpd2:.*${daemon}"
> > +
> > +rc_reload() {
> > +       pkill -HUP -oxf "${pexp}"
> > +}
> > +
> > rc_cmd $1
> >
> >
> >
> > Best regards,
> > Michael
> >
>
> --
> Antoine

--
Antoine

Loading...