Port 80 used by oom_reaper

I wiped my SSD for my pi and reinstalled everything, brought my old files back from a backup. Went to configure apache2, (broke many times, apache2 command throws an error so i can only use apache2ctl). I saw that i installed a bunch of random ram excessive programs. I deleted them and freed up ram. Free commands outputs this.

 free
                     total        used            free          shared  buff/cache   available
Mem:         982532      226540      535132        7132      243820      755992
Swap:        1115132          0           1115132

Then when i got to start apache2, i get this.

× apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; preset: enabled)
    Drop-In: /etc/systemd/system/apache2.service.d
             └─dietpi.conf
     Active: failed (Result: exit-code) since Tue 2023-09-12 13:22:08 BST; 4s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 1932 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
        CPU: 130ms

Sep 12 13:22:07 Adminpi systemd[1]: Starting apache2.service - The Apache HTTP Server...
Sep 12 13:22:08 Adminpi apachectl[1935]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Sep 12 13:22:08 Adminpi apachectl[1935]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Sep 12 13:22:08 Adminpi apachectl[1935]: no listening sockets available, shutting down
Sep 12 13:22:08 Adminpi apachectl[1935]: AH00015: Unable to open logs
Sep 12 13:22:08 Adminpi apachectl[1932]: Action 'start' failed.
Sep 12 13:22:08 Adminpi apachectl[1932]: The Apache error log may have more information.
Sep 12 13:22:08 Adminpi systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Sep 12 13:22:08 Adminpi systemd[1]: apache2.service: Failed with result 'exit-code'.
Sep 12 13:22:08 Adminpi systemd[1]: Failed to start apache2.service - The Apache HTTP Server.

when I check whats using port 80, i get this.

root@Adminpi:~# sudo ps -p 40
    PID TTY          TIME CMD
     40 ?        00:00:00 oom_reaper

I cant kill or change the config of oom_reaper because last time I did I didn’t have any memory to allocate. This time after a reboot I do have memory, but I don’t want to risk it again. There doesn’t seem to be much info about this process, but it kills random processes to free up memory apparently. Never seen it before. Is there any fixes to this problem?

Do you use a qnap device by any chance?

But your problem with apache is another: Some process already binds to port 80.

Can you show

sudo ss -tulpn
2 Likes

No I don’t have any devices connected, only a keyboard, mouse, and the external usb SSD.

root@Adminpi:/etc/apache2# sudo ss -tulpn
Netid       State         Recv-Q        Send-Q               Local Address:Port               Peer Address:Port       Process                                                                                      
udp         UNCONN        0             0                    192.168.1.255:137                     0.0.0.0:*           users:(("nmbd",pid=665,fd=16))                                                              
udp         UNCONN        0             0                    192.168.1.183:137                     0.0.0.0:*           users:(("nmbd",pid=665,fd=15))                                                              
udp         UNCONN        0             0                          0.0.0.0:137                     0.0.0.0:*           users:(("nmbd",pid=665,fd=13))                                                              
udp         UNCONN        0             0                    192.168.1.255:138                     0.0.0.0:*           users:(("nmbd",pid=665,fd=18))                                                              
udp         UNCONN        0             0                    192.168.1.183:138                     0.0.0.0:*           users:(("nmbd",pid=665,fd=17))                                                              
udp         UNCONN        0             0                          0.0.0.0:138                     0.0.0.0:*           users:(("nmbd",pid=665,fd=14))                                                              
udp         UNCONN        0             0                        127.0.0.1:5335                    0.0.0.0:*           users:(("unbound",pid=661,fd=3))                                                            
tcp         LISTEN        0             128                        0.0.0.0:22                      0.0.0.0:*           users:(("sshd",pid=659,fd=3))                                                               
tcp         LISTEN        0             64                         0.0.0.0:80                      0.0.0.0:*           users:(("haproxy",pid=669,fd=9))                                                            
tcp         LISTEN        0             50                         0.0.0.0:139                     0.0.0.0:*           users:(("smbd",pid=690,fd=31))                                                              
tcp         LISTEN        0             64                         0.0.0.0:1338                    0.0.0.0:*           users:(("haproxy",pid=669,fd=10))                                                           
tcp         LISTEN        0             50                         0.0.0.0:445                     0.0.0.0:*           users:(("smbd",pid=690,fd=30))                                                              
tcp         LISTEN        0             80                       127.0.0.1:3306                    0.0.0.0:*           users:(("mariadbd",pid=657,fd=21))                                                          
tcp         LISTEN        0             256                      127.0.0.1:5335                    0.0.0.0:*           users:(("unbound",pid=661,fd=4))                                                            
tcp         LISTEN        0             128                           [::]:22                         [::]:*           users:(("sshd",pid=659,fd=4))                                                               
tcp         LISTEN        0             50                            [::]:139                        [::]:*           users:(("smbd",pid=690,fd=29))                                                              
tcp         LISTEN        0             511                              *:8080                          *:*           users:(("apache2",pid=2020,fd=4),("apache2",pid=2019,fd=4),("apache2",pid=2018,fd=4))       
tcp         LISTEN        0             50                            [::]:445                        [::]:*           users:(("smbd",pid=690,fd=28))

wait hold on i know that program ive seen it in my downloads, haproxy is in the downloaded stuff i thought it was selected from before. should i delete it?

HAproxy is already running on port 80, this is the reason apache2 can not start.

btw
RAM looks fine to me, more then half is not used…

total        used        free      shared  buff/cache   available
982532      226540      535132        7132      243820      755992
2 Likes

If you dont need it you can uninstall it via dietpi-software.

2 Likes

alright lovely, sorry im very stupid i didnt even think to look at it. but why does the command i used in the post say that oom_reaper is using port 80? and why is it even running?

the command sudo ps -p 40 shows the process with the process ID 40, this has nothing to do with the sockets / ports.

1 Like

oh wtf digitalocean told me to use that command, unless i read it wrong then im an idiot. Anyways what about apache2 throwing this error.

root@Adminpi:~# apache2
[Tue Sep 12 13:51:46.226294 2023] [core:warn] [pid 2523] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 82 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot

Some syntax error in your config, the variable ${APACHE_RUN_DIR} .
I’m not so familiar with apache, but can you post your config here (perhaps remove personal data like used domains etc, if necessary)

cat /etc/apache2/apache2.conf

You could also try to reinstall apache2 via dietpi-software, but make a backup of your data beforehand.

ive conde apache configtest and it returns syntax as okay, MOST of the itme

root@Adminpi:~# apachectl configtest
Syntax OK

What happens if you try to restart the service?

sudo systemctl restart apache2.service
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; preset:
 enabled)
    Drop-In: /etc/systemd/system/apache2.service.d
             └─dietpi.conf
     Active: active (running) since Tue 2023-09-12 14:21:55 BST; 18s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 3604 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 3609 (apache2)
      Tasks: 105 (limit: 1069)
        CPU: 395ms
     CGroup: /system.slice/apache2.service
             ├─3609 /usr/sbin/apache2 -k start
             ├─3610 /usr/sbin/apache2 -k start
             └─3611 /usr/sbin/apache2 -k start

Sep 12 14:21:54 Adminpi systemd[1]: Starting apache2.service - The Apache HTTP Server...
Sep 12 14:21:55 Adminpi systemd[1]: Started apache2.service - The Apache HTTP Server.

i had to use systemctl status apache2 to show this cause it weirdly doesnt give an output anymore like it use to.

The systwmctl start command only gives you output back when something went wrong.
Looks fine, should be working now correctly?

The only thing which makes me wonder is the config error message. Maybe it came up because you tried to execute apache directly, and not the corresponding service.
Maybe somebody else can give an explanation.

i dont know all i know it back then i used apache2 command it would work or give me like a list of different things i could do with the command. now it doesnt. I also got my website connected to my domain and https. Should be working now. Tubzpi.xyz. Still need to work on the webstie and also get a dynamicdns script to update godaddy to have the most recent domain. Thanks a lot tho mate i appreciate it.

1 Like