Nachtzuster / BirdNET-Pi

A realtime acoustic bird classification system for the Raspberry Pi 5, 4B 3B+ 0W2 and more. Built on the TFLite version of BirdNET.
https://birdnetpi.com
Other
172 stars 24 forks source link

disable apache2 before enabling caddy #199

Closed wilkart closed 1 month ago

wilkart commented 2 months ago

apache2 is automatically starting as a dependency and needs to be disabled before starting caddy

alexbelgium commented 2 months ago

Hi, on my system this command fails with ERROR:systemctl:Unit apache2.service not found.

If this is an issue on your system, there should first be a check if the service exists. Here is how the code could perhaps be adapted :

if systemctl is-enabled --quiet apache2.service &>/dev/null; then
    systemctl disable apache2
fi

Another option would be to simply uninstall apache ?

Edit : added suppression of output to the if script

wilkart commented 2 months ago

@alexbelgium Good idea with checking if the apache2 service is indeed enabled.

The package is coming as a dependency during the installation. I see it in /var/log/apt/history.log "apache2-bin:arm64 (2.4.62-1~deb12u1, automatic)"

Commandline: apt install -qqy caddy ftpd sqlite3 php-sqlite3 alsa-utils pulseaudio avahi-utils sox libsox-fmt-mp3 php php-fpm php-curl php-xml php-zip icecast2 swig ffmpeg wget unzip curl cmake make bc libj
peg-dev zlib1g-dev python3-dev python3-pip python3-venv lsof net-tools
Nachtzuster commented 1 month ago

@wilkart are you sure this PR is done in the right repo? that log snippet seems to be from the original (dead) Bird-NET https://github.com/mcguirepr89/BirdNET-Pi/blob/f8e74cad351093f098b4e11d2fe4ef8ba6bc3482/scripts/install_services.sh#L20 and not from this repo: https://github.com/Nachtzuster/BirdNET-Pi/blob/96df8e781dfe5fc43f3c0f074c917dfe6a492bae/scripts/install_services.sh#L20

also: https://github.com/Nachtzuster/BirdNET-Pi/commit/2a68bb2e436927c6b0056111d48d7ffa7e28b4e8

wilkart commented 1 month ago

I am not sure what is dead and original. What I am sure the whole fresh installation makes apache2 installed as a dependency and started as a service on port 80 where later caddy cannot start. That is why I suggest to make sure apache2 is not running before caddy is enabled and started and listen on port 80.

alexbelgium commented 1 month ago

I am not sure what is dead and original

Which installer did you run, the one from nachzuster repo or the one from mcguirpr89? A way to check is : do you have the small Wikipedia icon on your overview page, that would indicate that you are running the version from this repo?

wilkart commented 1 month ago

I see the point. I will recheck that completely from scratch becasue indeed I could have run something at some moment from the other repository. I will reproduce once again.

wilkart commented 1 month ago

Dear @alexbelgium, @Nachtzuster I confirm what you have expected. On clean installation from this repository the apache2 does not come as a dependency and neither starting service automatically. I close this PR as not necessary. Thanks also for clarification - it looks like this repo is the most up to date and functional.