After uninstall, unable to complete reinstall

#1

Please follow the below template, it will help us to help you!

Expected Behaviour:

installation should complete

Actual Behaviour:

Last lines after curl install:

[✓] Detected x86_64 architecture
[i] Checking for existing FTL binary…
[✓] Downloading and Installing FTL
[✓] Creating user ‘pihole’
chown: invalid user: ‘lighttpd:lighttpd’
grep: /etc/pihole/setupVars.conf: No such file or directory
[i] Testing if systemd-resolved is enabled
[i] Systemd-resolved does not need to be restarted
[✓] Restarting lighttpd service…
[✓] Enabling lighttpd service to start on reboot…
[i] Restarting services…
[✓] Enabling pihole-FTL service to start on reboot…

Debug Token:

unable to provide token. pihole commands do not work.

#2

FYI, I found another thread that had a similar issue. It seems to be related to lightppd. I ran through the installation, this time not installing the web console or the lighttpd server, and it worked fine. Now I need to somehow get those to install.

Ideas on why they won’t install?

#3

Something going wrong in below bit of the install script trying to change ownership with a non existent user “lighttpd”:

# Install base files and web interface
installPihole() {
    # Create the pihole user
    create_pihole_user

    # If the user wants to install the Web interface,
    if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
        if [[ ! -d "${webroot}" ]]; then
            # make the Web directory if necessary
            install -d -m 0755 ${webroot}
        fi

        if [[ "${INSTALL_WEB_SERVER}" == true ]]; then
            # Set the owner and permissions
            chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} ${webroot}
            chmod 0775 ${webroot}

Whats the OS ?

lsb_release -a

Does that lighttpd user exist ?

grep lighttpd /etc/passwd

Is lighttpd already installed ?

apt policy lighttpd

Is it running ?

sudo service lighttpd status

If running, what user is it running under:

ps -o user -C lighttpd

If no lighttpd installed, try install manually:

sudo apt install lighttpd

And run the Pi-hole install again.

#4

I made some progress. I got lighttpd to install, by running dns remove lighttpd, and then ran pihole -r again. This time it installed it. I am now getting what looks like permission issues.

Whats the OS ? - Fedora 27 Server

Does that lighttpd user exist ?

grep lighttpd /etc/passwd
lighttpd:x:983:982:lighttpd web server:/var/www/lighttpd:/sbin/nologin

Is lighttpd already installed ? Yes, it is now.

Is it running ? No.

[root@galactica lighttpd]# systemctl status lighttpd.service
lighttpd.service - Lightning Fast Webserver With Light System Requirements
Loaded: loaded (/usr/lib/systemd/system/lighttpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2019-06-12 08:20:25 EDT; 2s ago
Process: 13031 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=25
Main PID: 13031 (code=exited, status=255)

Jun 12 08:20:25 galactica.starfleet.org lighttpd[13031]: 2019-06-12 08:20:25: (server.c.746) opening errorlog ‘/var/log/lighttpd/error.log’ fail
Jun 12 08:20:25 galactica.starfleet.org lighttpd[13031]: 2019-06-12 08:20:25: (server.c.1433) Opening errorlog failed. Going down.

If running, what user is it running under:

ps -o user -C lighttpd
[root@galactica lighttpd]# systemctl status lighttpd.service

If no lighttpd installed, try install manually:

sudo apt install lighttpd

#5

journalctl -u lighttpd --full --no-pager

?

#6

Here’s the lastest. Like I said, I had it installed before, and it worked fine, but my server installation got borked and I had to uninstall and reinstall some stuff to get things working again.

Jun 12 08:18:48 galactica.starfleet.org systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Jun 12 08:18:48 galactica.starfleet.org systemd[1]: lighttpd.service: Unit entered failed state.
Jun 12 08:18:48 galactica.starfleet.org systemd[1]: lighttpd.service: Failed with result ‘exit-code’.
Jun 12 08:20:25 galactica.starfleet.org systemd[1]: Started Lightning Fast Webserver With Light System Requirements.
Jun 12 08:20:25 galactica.starfleet.org lighttpd[13031]: 2019-06-12 08:20:25: (server.c.746) opening errorlog ‘/var/log/lighttpd/error.log’ failed: Permission denied
Jun 12 08:20:25 galactica.starfleet.org lighttpd[13031]: 2019-06-12 08:20:25: (server.c.1433) Opening errorlog failed. Going down.
Jun 12 08:20:25 galactica.starfleet.org systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Jun 12 08:20:25 galactica.starfleet.org systemd[1]: lighttpd.service: Unit entered failed state.
Jun 12 08:20:25 galactica.starfleet.org systemd[1]: lighttpd.service: Failed with result ‘exit-code’.

#7

For diagnosing, try do below:

sudo chmod 777 -R /var/log/lighttpd

Start lighttpd:

sudo service lighttpd restart

Check again:

sudo service lighttpd status

And if running, check what user its running under:

ps -o user -C lighttpd

EDIT: See below for setting proper ownership and permissions of that /var/log/lighttpd folder !

#8

that seems to have worked. Thanks!

[root@galactica lighttpd]# systemctl status lighttpd.service
● lighttpd.service - Lightning Fast Webserver With Light System Requirements
Loaded: loaded (/usr/lib/systemd/system/lighttpd.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2019-06-12 08:38:15 EDT; 5s ago
Main PID: 14335 (lighttpd)
Tasks: 9 (limit: 4915)
CGroup: /system.slice/lighttpd.service
├─14335 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
├─14338 /usr/bin/php-cgi
├─14339 /usr/bin/php-cgi
├─14340 /usr/bin/php-cgi
├─14341 /usr/bin/php-cgi
├─14342 /usr/bin/php-cgi
├─14343 /usr/bin/php-cgi
├─14344 /usr/bin/php-cgi
└─14345 /usr/bin/php-cgi

Jun 12 08:38:15 galactica.starfleet.org systemd[1]: Started Lightning Fast Webserver With Light System Requirements.
[root@galactica lighttpd]# ps -o user -C lighttpd.conf
USER

#9

No user ?
Maybe need sudo (EDIT: no need for sudo if run as root user):

sudo ps -o user -C lighttpd

EDIT: not over yet, still need to set proper ownership and permissions for the /var/log/lighttpd folder

EDIT2: I wasn’t paying attention, we’re interested in the “lighttpd” process and not the “lighttpd.conf” file !

Try again:

ps -o user -C lighttpd

#10

[root@galactica etc]# ps -o user -C lighttpd
USER
lighttpd

#11

For proper ownership:

sudo chown lighttpd:lighttpd -R /var/log/lighttpd

For proper permissions:

sudo chmod 750 /var/log/lighttpd

sudo chmod 644 /var/log/lighttpd/*

Restart:

sudo service lighttpd restart

And check:

sudo service lighttpd status

#12

Webinterface was working before, but permissions are changed. Still appears to be working properly.

[root@galactica sbin]# systemctl status lighttpd.service
● lighttpd.service - Lightning Fast Webserver With Light System Requirements
Loaded: loaded (/usr/lib/systemd/system/lighttpd.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2019-06-12 09:17:47 EDT; 1min 13s ago
Main PID: 21942 (lighttpd)
Tasks: 9 (limit: 4915)
CGroup: /system.slice/lighttpd.service
├─21942 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
├─21945 /usr/bin/php-cgi
├─21946 /usr/bin/php-cgi
├─21947 /usr/bin/php-cgi
├─21948 /usr/bin/php-cgi
├─21949 /usr/bin/php-cgi
├─21950 /usr/bin/php-cgi
├─21951 /usr/bin/php-cgi
└─21952 /usr/bin/php-cgi

Jun 12 09:17:47 galactica.starfleet.org systemd[1]: Started Lightning Fast Webserver With Light System Requirements.

1 Like
#13

Permissions did actually make a difference. I noticed there was another failure in systemctl.

[root@galactica sbin]# systemctl | grep failed
● systemd-tmpfiles-clean.service loaded failed failed Cleanup of Temporary Directories
[root@galactica sbin]# systemctl status systemd-tmpfiles-clean.service
● systemd-tmpfiles-clean.service - Cleanup of Temporary Directories
Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.service; static; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2019-06-11 18:59:10 EDT; 14h ago
Docs: man:tmpfiles.d(5)
man:systemd-tmpfiles(8)
Main PID: 9613 (code=exited, status=1/FAILURE)

Jun 11 18:59:10 galactica.starfleet.org systemd[1]: Starting Cleanup of Temporary Directories…
Jun 11 18:59:10 galactica.starfleet.org systemd-tmpfiles[9613]: [/etc/tmpfiles.d/lighttpd.conf:1] Unknown user ‘lighttpd’.
Jun 11 18:59:10 galactica.starfleet.org systemd[1]: systemd-tmpfiles-clean.service: Main process exited, code=exited, status=1/FAILURE
Jun 11 18:59:10 galactica.starfleet.org systemd[1]: Failed to start Cleanup of Temporary Directories.
Jun 11 18:59:10 galactica.starfleet.org systemd[1]: systemd-tmpfiles-clean.service: Unit entered failed state.
Jun 11 18:59:10 galactica.starfleet.org systemd[1]: systemd-tmpfiles-clean.service: Failed with result ‘exit-code’.
[root@galactica sbin]# systemctl restart systemd-tmpfiles-clean.service
[root@galactica sbin]# systemctl status systemd-tmpfiles-clean.service
● systemd-tmpfiles-clean.service - Cleanup of Temporary Directories
Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.service; static; vendor preset: disabled)
Active: inactive (dead) since Wed 2019-06-12 09:21:31 EDT; 2s ago
Docs: man:tmpfiles.d(5)
man:systemd-tmpfiles(8)
Process: 22615 ExecStart=/usr/bin/systemd-tmpfiles --clean (code=exited, status=0/SUCCESS)
Main PID: 22615 (code=exited, status=0/SUCCESS)

Jun 12 09:21:31 galactica.starfleet.org systemd[1]: Starting Cleanup of Temporary Directories…
Jun 12 09:21:31 galactica.starfleet.org systemd[1]: Started Cleanup of Temporary Directories.

#14

look at the date/time.

#15

Good point. Last night was when I was trying to figure out the whole lighttpd issue on my own.