Skip to main content
added 17 characters in body
Source Link
Mark
  • 805
  • 1
  • 14
  • 28

I'm facing an odd problem on a Buildroot environment for RPi3. I have this init.d service to start apache2 (version 2.4.57):

# cat /etc/init.d/S50apache 
#!/bin/sh

case "$1" in
  start|restart|graceful|graceful-stop|stop)
    apachectl -k $1
    ;;
  reload)
    apachectl -k restart
    ;;
  *)
    echo "Usage: $0 {start|restart|reload|graceful|graceful-stop|stop}"
    exit 1
esac

exit $?

Often, when I power up the RPi3 I notice the web server is not running. If I try to run the very same command, i.e.:

# apachectl -k start

I get:

httpd (pid 288) already running

but:

# ps aux | grep httpd
  477 root     grep httpd

and:

# ps aux | grep 288
  288 root     /usr/sbin/wpa_supplicant -u
  457 root     grep 288

It seems obvious (unless I'm missing something) that apache2 is not running and the PID 288 is about a completely different service.

In order to start the webserver I have to:

  1. apachectl -k stop -> this actually stops the wpa_supplicant service!
  2. restart the wpa_supplicant service
  3. now apachectl -k start works and the apache2 service runs

Of course this is not acceptable. Furthermore, the machine will be unattended hence I need to fix this issue.

But I first have to understand why it happens. How is it possible it thinks it has a different PID?

I'm facing an odd problem on a Buildroot environment for RPi3. I have this init.d service to start apache2:

# cat /etc/init.d/S50apache 
#!/bin/sh

case "$1" in
  start|restart|graceful|graceful-stop|stop)
    apachectl -k $1
    ;;
  reload)
    apachectl -k restart
    ;;
  *)
    echo "Usage: $0 {start|restart|reload|graceful|graceful-stop|stop}"
    exit 1
esac

exit $?

Often, when I power up the RPi3 I notice the web server is not running. If I try to run the very same command, i.e.:

# apachectl -k start

I get:

httpd (pid 288) already running

but:

# ps aux | grep httpd
  477 root     grep httpd

and:

# ps aux | grep 288
  288 root     /usr/sbin/wpa_supplicant -u
  457 root     grep 288

It seems obvious (unless I'm missing something) that apache2 is not running and the PID 288 is about a completely different service.

In order to start the webserver I have to:

  1. apachectl -k stop -> this actually stops the wpa_supplicant service!
  2. restart the wpa_supplicant service
  3. now apachectl -k start works and the apache2 service runs

Of course this is not acceptable. Furthermore, the machine will be unattended hence I need to fix this issue.

But I first have to understand why it happens. How is it possible it thinks it has a different PID?

I'm facing an odd problem on a Buildroot environment for RPi3. I have this init.d service to start apache2 (version 2.4.57):

# cat /etc/init.d/S50apache 
#!/bin/sh

case "$1" in
  start|restart|graceful|graceful-stop|stop)
    apachectl -k $1
    ;;
  reload)
    apachectl -k restart
    ;;
  *)
    echo "Usage: $0 {start|restart|reload|graceful|graceful-stop|stop}"
    exit 1
esac

exit $?

Often, when I power up the RPi3 I notice the web server is not running. If I try to run the very same command, i.e.:

# apachectl -k start

I get:

httpd (pid 288) already running

but:

# ps aux | grep httpd
  477 root     grep httpd

and:

# ps aux | grep 288
  288 root     /usr/sbin/wpa_supplicant -u
  457 root     grep 288

It seems obvious (unless I'm missing something) that apache2 is not running and the PID 288 is about a completely different service.

In order to start the webserver I have to:

  1. apachectl -k stop -> this actually stops the wpa_supplicant service!
  2. restart the wpa_supplicant service
  3. now apachectl -k start works and the apache2 service runs

Of course this is not acceptable. Furthermore, the machine will be unattended hence I need to fix this issue.

But I first have to understand why it happens. How is it possible it thinks it has a different PID?

added 1 character in body
Source Link
Mark
  • 805
  • 1
  • 14
  • 28

I'm facing an odd problem on a Buildroot environment for RPi3. I have this init.d service to start apache2:

# cat /etc/init.d/S50apache 
#!/bin/sh

case "$1" in
  start|restart|graceful|graceful-stop|stop)
    apachectl -k $1
    ;;
  reload)
    apachectl -k restart
    ;;
  *)
    echo "Usage: $0 {start|restart|reload|graceful|graceful-stop|stop}"
    exit 1
esac

exit $?

Often, when I power up the RPi3 I notice the web server is not running. If I try to run the very same command, i.e.:

# apachectl -k start

I get:

httpd (pid 288) already running

but:

# ps aux | grep httpd
  477 root     grep httpd

and:

# ps aux | grep 288
  288 root     /usr/sbin/wpa_supplicant -u
  457 root     grep 288

It seems obvious (unless I'm missing something) that apache2 is not running and the PID 288 is about a completely different service.

In order to start the webserver I have to:

  1. apachectl -k stop -> this actually stopstops the wpa_supplicant service!
  2. restart the wpa_supplicant service
  3. now apachectl -k start works and the apache2 service runs

Of course this is not acceptable. Furthermore, the machine will be unattended hence I need to fix this issue.

But I first have to understand why it happens. How is it possible it thinks it has a different PID?

I'm facing an odd problem on a Buildroot environment for RPi3. I have this init.d service to start apache2:

# cat /etc/init.d/S50apache 
#!/bin/sh

case "$1" in
  start|restart|graceful|graceful-stop|stop)
    apachectl -k $1
    ;;
  reload)
    apachectl -k restart
    ;;
  *)
    echo "Usage: $0 {start|restart|reload|graceful|graceful-stop|stop}"
    exit 1
esac

exit $?

Often, when I power up the RPi3 I notice the web server is not running. If I try to run the very same command, i.e.:

# apachectl -k start

I get:

httpd (pid 288) already running

but:

# ps aux | grep httpd
  477 root     grep httpd

and:

# ps aux | grep 288
  288 root     /usr/sbin/wpa_supplicant -u
  457 root     grep 288

It seems obvious (unless I'm missing something) that apache2 is not running and the PID 288 is about a completely different service.

In order to start the webserver I have to:

  1. apachectl -k stop -> this actually stop the wpa_supplicant service!
  2. restart the wpa_supplicant service
  3. now apachectl -k start works and the apache2 service runs

Of course this is not acceptable. Furthermore, the machine will be unattended hence I need to fix this issue.

But I first have to understand why it happens. How is it possible it thinks it has a different PID?

I'm facing an odd problem on a Buildroot environment for RPi3. I have this init.d service to start apache2:

# cat /etc/init.d/S50apache 
#!/bin/sh

case "$1" in
  start|restart|graceful|graceful-stop|stop)
    apachectl -k $1
    ;;
  reload)
    apachectl -k restart
    ;;
  *)
    echo "Usage: $0 {start|restart|reload|graceful|graceful-stop|stop}"
    exit 1
esac

exit $?

Often, when I power up the RPi3 I notice the web server is not running. If I try to run the very same command, i.e.:

# apachectl -k start

I get:

httpd (pid 288) already running

but:

# ps aux | grep httpd
  477 root     grep httpd

and:

# ps aux | grep 288
  288 root     /usr/sbin/wpa_supplicant -u
  457 root     grep 288

It seems obvious (unless I'm missing something) that apache2 is not running and the PID 288 is about a completely different service.

In order to start the webserver I have to:

  1. apachectl -k stop -> this actually stops the wpa_supplicant service!
  2. restart the wpa_supplicant service
  3. now apachectl -k start works and the apache2 service runs

Of course this is not acceptable. Furthermore, the machine will be unattended hence I need to fix this issue.

But I first have to understand why it happens. How is it possible it thinks it has a different PID?

Source Link
Mark
  • 805
  • 1
  • 14
  • 28

Apache refuses to start claiming a wrong PID

I'm facing an odd problem on a Buildroot environment for RPi3. I have this init.d service to start apache2:

# cat /etc/init.d/S50apache 
#!/bin/sh

case "$1" in
  start|restart|graceful|graceful-stop|stop)
    apachectl -k $1
    ;;
  reload)
    apachectl -k restart
    ;;
  *)
    echo "Usage: $0 {start|restart|reload|graceful|graceful-stop|stop}"
    exit 1
esac

exit $?

Often, when I power up the RPi3 I notice the web server is not running. If I try to run the very same command, i.e.:

# apachectl -k start

I get:

httpd (pid 288) already running

but:

# ps aux | grep httpd
  477 root     grep httpd

and:

# ps aux | grep 288
  288 root     /usr/sbin/wpa_supplicant -u
  457 root     grep 288

It seems obvious (unless I'm missing something) that apache2 is not running and the PID 288 is about a completely different service.

In order to start the webserver I have to:

  1. apachectl -k stop -> this actually stop the wpa_supplicant service!
  2. restart the wpa_supplicant service
  3. now apachectl -k start works and the apache2 service runs

Of course this is not acceptable. Furthermore, the machine will be unattended hence I need to fix this issue.

But I first have to understand why it happens. How is it possible it thinks it has a different PID?