{"action":"created","issue":{"url":"https://api.github.com/repos/Fourdee/DietPi/issues/1696","repository_url":"https://api.github.com/repos/Fourdee/DietPi","labels_url":"https://api.github.com/repos/Fourdee/DietPi/issues/1696/labels{/name}","comments_url":"https://api.github.com/repos/Fourdee/DietPi/issues/1696/comments","events_url":"https://api.github.com/repos/Fourdee/DietPi/issues/1696/events","html_url":"https://github.com/Fourdee/DietPi/issues/1696","id":313028698,"node_id":"MDU6SXNzdWUzMTMwMjg2OTg=","number":1696,"title":"DietPi-Software | Pi-hole: Solve issues with internal installer/updater","user":{"login":"MichaIng","id":28480705,"node_id":"MDQ6VXNlcjI4NDgwNzA1","avatar_url":"https://avatars2.githubusercontent.com/u/28480705?v=4","gravatar_id":"","url":"https://api.github.com/users/MichaIng","html_url":"https://github.com/MichaIng","followers_url":"https://api.github.com/users/MichaIng/followers","following_url":"https://api.github.com/users/MichaIng/following{/other_user}","gists_url":"https://api.github.com/users/MichaIng/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaIng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaIng/subscriptions","organizations_url":"https://api.github.com/users/MichaIng/orgs","repos_url":"https://api.github.com/users/MichaIng/repos","events_url":"https://api.github.com/users/MichaIng/events{/privacy}","received_events_url":"https://api.github.com/users/MichaIng/received_events","type":"User","site_admin":false},"labels":[{"id":187191721,"node_id":"MDU6TGFiZWwxODcxOTE3MjE=","url":"https://api.github.com/repos/Fourdee/DietPi/labels/Bug%20:beetle:","name":"Bug :beetle:","color":"fc2929","default":false},{"id":883954154,"node_id":"MDU6TGFiZWw4ODM5NTQxNTQ=","url":"https://api.github.com/repos/Fourdee/DietPi/labels/External%20Bug%20:beetle:","name":"External Bug :beetle:","color":"fc2929","default":false},{"id":576178947,"node_id":"MDU6TGFiZWw1NzYxNzg5NDc=","url":"https://api.github.com/repos/Fourdee/DietPi/labels/Workaround/Fix%20available%20:clinking_glasses:","name":"Workaround/Fix available :clinking_glasses:","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":{"login":"Fourdee","id":7077026,"node_id":"MDQ6VXNlcjcwNzcwMjY=","avatar_url":"https://avatars3.githubusercontent.com/u/7077026?v=4","gravatar_id":"","url":"https://api.github.com/users/Fourdee","html_url":"https://github.com/Fourdee","followers_url":"https://api.github.com/users/Fourdee/followers","following_url":"https://api.github.com/users/Fourdee/following{/other_user}","gists_url":"https://api.github.com/users/Fourdee/gists{/gist_id}","starred_url":"https://api.github.com/users/Fourdee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fourdee/subscriptions","organizations_url":"https://api.github.com/users/Fourdee/orgs","repos_url":"https://api.github.com/users/Fourdee/repos","events_url":"https://api.github.com/users/Fourdee/events{/privacy}","received_events_url":"https://api.github.com/users/Fourdee/received_events","type":"User","site_admin":false},"assignees":[{"login":"Fourdee","id":7077026,"node_id":"MDQ6VXNlcjcwNzcwMjY=","avatar_url":"https://avatars3.githubusercontent.com/u/7077026?v=4","gravatar_id":"","url":"https://api.github.com/users/Fourdee","html_url":"https://github.com/Fourdee","followers_url":"https://api.github.com/users/Fourdee/followers","following_url":"https://api.github.com/users/Fourdee/following{/other_user}","gists_url":"https://api.github.com/users/Fourdee/gists{/gist_id}","starred_url":"https://api.github.com/users/Fourdee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fourdee/subscriptions","organizations_url":"https://api.github.com/users/Fourdee/orgs","repos_url":"https://api.github.com/users/Fourdee/repos","events_url":"https://api.github.com/users/Fourdee/events{/privacy}","received_events_url":"https://api.github.com/users/Fourdee/received_events","type":"User","site_admin":false},{"login":"k-plan","id":17237601,"node_id":"MDQ6VXNlcjE3MjM3NjAx","avatar_url":"https://avatars3.githubusercontent.com/u/17237601?v=4","gravatar_id":"","url":"https://api.github.com/users/k-plan","html_url":"https://github.com/k-plan","followers_url":"https://api.github.com/users/k-plan/followers","following_url":"https://api.github.com/users/k-plan/following{/other_user}","gists_url":"https://api.github.com/users/k-plan/gists{/gist_id}","starred_url":"https://api.github.com/users/k-plan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-plan/subscriptions","organizations_url":"https://api.github.com/users/k-plan/orgs","repos_url":"https://api.github.com/users/k-plan/repos","events_url":"https://api.github.com/users/k-plan/events{/privacy}","received_events_url":"https://api.github.com/users/k-plan/received_events","type":"User","site_admin":false},{"login":"MichaIng","id":28480705,"node_id":"MDQ6VXNlcjI4NDgwNzA1","avatar_url":"https://avatars2.githubusercontent.com/u/28480705?v=4","gravatar_id":"","url":"https://api.github.com/users/MichaIng","html_url":"https://github.com/MichaIng","followers_url":"https://api.github.com/users/MichaIng/followers","following_url":"https://api.github.com/users/MichaIng/following{/other_user}","gists_url":"https://api.github.com/users/MichaIng/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaIng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaIng/subscriptions","organizations_url":"https://api.github.com/users/MichaIng/orgs","repos_url":"https://api.github.com/users/MichaIng/repos","events_url":"https://api.github.com/users/MichaIng/events{/privacy}","received_events_url":"https://api.github.com/users/MichaIng/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Fourdee/DietPi/milestones/74","html_url":"https://github.com/Fourdee/DietPi/milestone/74","labels_url":"https://api.github.com/repos/Fourdee/DietPi/milestones/74/labels","id":3396210,"node_id":"MDk6TWlsZXN0b25lMzM5NjIxMA==","number":74,"title":"v6.10","description":null,"creator":{"login":"MichaIng","id":28480705,"node_id":"MDQ6VXNlcjI4NDgwNzA1","avatar_url":"https://avatars2.githubusercontent.com/u/28480705?v=4","gravatar_id":"","url":"https://api.github.com/users/MichaIng","html_url":"https://github.com/MichaIng","followers_url":"https://api.github.com/users/MichaIng/followers","following_url":"https://api.github.com/users/MichaIng/following{/other_user}","gists_url":"https://api.github.com/users/MichaIng/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaIng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaIng/subscriptions","organizations_url":"https://api.github.com/users/MichaIng/orgs","repos_url":"https://api.github.com/users/MichaIng/repos","events_url":"https://api.github.com/users/MichaIng/events{/privacy}","received_events_url":"https://api.github.com/users/MichaIng/received_events","type":"User","site_admin":false},"open_issues":29,"closed_issues":19,"state":"open","created_at":"2018-06-03T10:37:41Z","updated_at":"2018-06-21T18:28:46Z","due_on":null,"closed_at":null},"comments":39,"created_at":"2018-04-10T17:56:31Z","updated_at":"2018-06-22T19:27:50Z","closed_at":null,"author_association":"COLLABORATOR","body":"Let's focus on this and get it solved for v6.7:\r\nNew issue to merge: https://github.com/Fourdee/DietPi/issues/1313 + https://github.com/Fourdee/DietPi/issues/1375 + https://github.com/Fourdee/DietPi/issues/1623\r\n\r\nPi-hole internal installer and updater breaks DietPi with the following:\r\n- Installs `lighttpd`, even if other webserver is already present, causing one to fail.\r\n- Overwrites `lighttpd.conf`, reverting Pi-hole to be the only served web page.\r\n- Installs `dhcpcd5`, possibly causing issues in combination with DietPi default `isc-dhcp-client`.\r\n\r\nAs we cannot know, when user starts `pihole -up` / `-r`, thus also cannot directly edit Pi-hole scripts, a solution worth testing is to adjust `pihole-FTP.service` start/stop scripts via `/etc/systemd/system/pihole-FTP.service.d/dietpi.conf`.\r\n\r\nSo far I have this:\r\n```\r\nroot@DietPi:/var/www/pihole# cat /etc/systemd/system/pihole-FTL.service.d/dietpi.conf\r\n[Service]\r\nExecStartPre=/bin/bash -c '/var/lib/dietpi/dietpi-software/services/pihole-startpre.sh'\r\nExecStopPost=/bin/bash -c '/var/lib/dietpi/dietpi-software/services/pihole-stoppost.sh'\r\nroot@DietPi:/var/www/pihole# cat /var/lib/dietpi/dietpi-software/services/pihole-stoppost.sh\r\n#!/bin/bash\r\n# As PiHole overwrites our lighttpd.conf, we need to do a backup in case, using pihole-FTL ExecStopPost.\r\n\r\n# Do lighttpd.conf backup, if installed via dietpi-software:\r\ngrep -q \"aSOFTWARE_INSTALL_STATE\\[84\\]=2\" /DietPi/dietpi/.installed && [ ! -f /mnt/dietpi_userdata/lighttpd.conf.bak ] && cp /etc/lighttpd/lighttpd.conf /mnt/dietpi_userdata/lighttpd.conf.bak\r\n\r\nexit 0\r\nroot@DietPi:/var/www/pihole# cat /var/lib/dietpi/dietpi-software/services/pihole-startpre.sh\r\n#!/bin/bash\r\n# As PiHole installs lighttpd, dhcpcd5 and overwrites our lighttpd.conf,\r\n# we need to purge those packages in case or recover our lighttpd.conf.\r\n# To assure this on installation, reconfiguration and update, we do this on pihole-FTL ExecStartPre.\r\n\r\ndpkg --get-selections > /tmp/dpkg-selections\r\n\r\n# Purge dhcpcd5, if our default isc-dhcp-client is installed:\r\ngrep -q 'dhcpcd5' /tmp/dpkg-selections && grep -q 'isc-dhcp-client' /tmp/dpkg-selections && DEBIAN_FRONTEND=noninteractive apt-get purge -y dhcpcd5\r\n\r\n# Purge lighttpd, if another webserver is (to be) installed via dietpi-software:\r\ngrep -q \"aSOFTWARE_INSTALL_STATE\\[8[35]\\]=[12]\" /DietPi/dietpi/.installed && grep -q 'lighttpd' /tmp/dpkg-selections && DEBIAN_FRONTEND=noninteractive apt-get purge -y lighttpd\r\n\r\n# Recover lighttpd.conf, if backup was made:\r\ngrep -q \"aSOFTWARE_INSTALL_STATE\\[84\\]=2\" /DietPi/dietpi/.installed && mv /mnt/dietpi_userdata/lighttpd.conf.bak /etc/lighttpd/lighttpd.conf\r\n\r\nexit 0\r\nroot@DietPi:/var/www/pihole# systemctl status pihole-FTL.service\r\n● pihole-FTL.service - LSB: pihole-FTL daemon\r\n   Loaded: loaded (/etc/init.d/pihole-FTL; generated; vendor preset: enabled)\r\n  Drop-In: /etc/systemd/system/pihole-FTL.service.d\r\n           └─dietpi.conf\r\n   Active: active (running) since Tue 2018-04-10 18:17:38 CEST; 10s ago\r\n     Docs: man:systemd-sysv-generator(8)\r\n  Process: 26269 ExecStopPost=/bin/bash -c /var/lib/dietpi/dietpi-software/services/pihole-stoppost.sh (code=exited, status=0/SUCCESS)\r\n  Process: 26238 ExecStop=/etc/init.d/pihole-FTL stop (code=exited, status=0/SUCCESS)\r\n  Process: 26281 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)\r\n  Process: 26273 ExecStartPre=/bin/bash -c /var/lib/dietpi/dietpi-software/services/pihole-startpre.sh (code=exited, status=0/SUCCESS)\r\n    Tasks: 5 (limit: 4915)\r\n   CGroup: /system.slice/pihole-FTL.service\r\n           └─26328 /usr/bin/pihole-FTL\r\n\r\nApr 10 18:17:38 DietPi systemd[1]: Stopped LSB: pihole-FTL daemon.\r\nApr 10 18:17:38 DietPi systemd[1]: Starting LSB: pihole-FTL daemon...\r\nApr 10 18:17:38 DietPi pihole-FTL[26281]: Not running\r\nApr 10 18:17:38 DietPi pihole-FTL[26281]: chown: cannot access '/etc/pihole/dhcp.leases': No such file or directory\r\nApr 10 18:17:38 DietPi su[26322]: Successful su for pihole by root\r\nApr 10 18:17:38 DietPi su[26322]: + ??? root:pihole\r\nApr 10 18:17:38 DietPi su[26322]: pam_unix(su:session): session opened for user pihole by (uid=0)\r\nApr 10 18:17:38 DietPi pihole-FTL[26281]: FTL started!\r\nApr 10 18:17:38 DietPi systemd[1]: Started LSB: pihole-FTL daemon.\r\n```\r\n- Now forcing reinstall:\r\n```\r\nroot@DietPi:/var/www/pihole# pihole -r\r\n...\r\n  [i] Checking for lighttpd (will be installed)\r\n...\r\n  [✓] Starting lighttpd service\r\n  [✓] Enabling lighttpd service to start on reboot\r\n...\r\n  [✓] Pi-hole blocking is Enabled\r\n\r\n  [i] The install log is located at: /etc/pihole/install.log\r\n  Update Complete!\r\n...\r\nroot@DietPi:/var/www/pihole# journalctl -r\r\nApr 10 18:01:18 DietPi lighttpd[23242]: 2018-04-10 18:01:18: (network.c.473) listen failed:  Address already in use\r\nApr 10 18:01:18 DietPi systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a\r\nApr 10 18:01:18 DietPi systemd[1]: lighttpd.service: Unit entered failed state.\r\nApr 10 18:01:18 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.\r\nApr 10 18:01:18 DietPi bash[23188]: The following package was automatically installed and is no longer required:\r\nApr 10 18:01:18 DietPi bash[23188]:   libfam0\r\nApr 10 18:01:18 DietPi bash[23188]: Use 'apt autoremove' to remove it.\r\nApr 10 18:01:18 DietPi systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.\r\nApr 10 18:01:18 DietPi bash[23188]: The following packages will be REMOVED:\r\nApr 10 18:01:18 DietPi bash[23188]:   lighttpd*\r\nApr 10 18:01:18 DietPi systemd[1]: Stopped Lighttpd Daemon.\r\nApr 10 18:01:18 DietPi systemd[1]: Starting Lighttpd Daemon...\r\nApr 10 18:01:18 DietPi systemd[1]: Started Lighttpd Daemon.\r\nApr 10 18:01:18 DietPi lighttpd[23265]: 2018-04-10 18:01:18: (network.c.473) listen failed:  Address already in use\r\nApr 10 18:01:18 DietPi systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a\r\nApr 10 18:01:18 DietPi systemd[1]: lighttpd.service: Unit entered failed state.\r\nApr 10 18:01:18 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.\r\nApr 10 18:01:18 DietPi systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.\r\nApr 10 18:01:18 DietPi systemd[1]: Stopped Lighttpd Daemon.\r\nApr 10 18:01:18 DietPi systemd[1]: Starting Lighttpd Daemon...\r\nApr 10 18:01:18 DietPi systemd[1]: Started Lighttpd Daemon.\r\nApr 10 18:01:18 DietPi bash[23188]: 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.\r\nApr 10 18:01:18 DietPi bash[23188]: After this operation, 974 kB disk space will be freed.\r\nApr 10 18:01:18 DietPi lighttpd[23294]: 2018-04-10 18:01:18: (network.c.473) listen failed:  Address already in use\r\nApr 10 18:01:18 DietPi systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a\r\nApr 10 18:01:18 DietPi systemd[1]: lighttpd.service: Unit entered failed state.\r\nApr 10 18:01:18 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.\r\nApr 10 18:01:18 DietPi bash[23188]: [614B blob data]\r\nApr 10 18:01:18 DietPi bash[23188]: Removing lighttpd (1.4.45-1) ...\r\nApr 10 18:01:18 DietPi systemd[1]: Reloading.\r\nApr 10 18:01:19 DietPi systemd[1]: Stopped Lighttpd Daemon.\r\nApr 10 18:01:19 DietPi systemd[1]: Reloading.\r\nApr 10 18:01:19 DietPi systemd[1]: Reloading.\r\nApr 10 18:01:19 DietPi bash[23188]: [614B blob data]\r\nApr 10 18:01:19 DietPi bash[23188]: Purging configuration files for lighttpd (1.4.45-1) ...\r\n...\r\n```\r\n- As can be seen, lighttpd fails due to port already used by apache and startup attempt is repeated until our purge is done.\r\n- Pi-hole installation went through without error, but I also already saw errors there and I am not sure, if the installation/update goes through fully in every case. Needs some testing on fresh system again.\r\n- We could stop/start apache/nginx with pihole-FTL to assure Lighttpd is working correctly during update/install/reconfigure, but I don't like this done \"silently\", where users might want to stop pihole but keep webserver running...\r\n- The missing /etc/pihole/dhcp.leases btw. has nothing to do with dhcpcd5, as on my VM I test systemd-networkd, thus do not have isc-dhcp-client installed, thus dhcpcd5 is not purged 😉.\r\n_________________________\r\nPi-hole btw. will merge dnsmasq into pihole-FTP: https://pi-hole.net/2018/03/24/help-us-beta-test-ftldns/\r\n- As on current state the service name did not change, this doesn't affect the solution above."},"comment":{"url":"https://api.github.com/repos/Fourdee/DietPi/issues/comments/399556476","html_url":"https://github.com/Fourdee/DietPi/issues/1696#issuecomment-399556476","issue_url":"https://api.github.com/repos/Fourdee/DietPi/issues/1696","id":399556476,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTU1NjQ3Ng==","user":{"login":"slim0287","id":30515195,"node_id":"MDQ6VXNlcjMwNTE1MTk1","avatar_url":"https://avatars3.githubusercontent.com/u/30515195?v=4","gravatar_id":"","url":"https://api.github.com/users/slim0287","html_url":"https://github.com/slim0287","followers_url":"https://api.github.com/users/slim0287/followers","following_url":"https://api.github.com/users/slim0287/following{/other_user}","gists_url":"https://api.github.com/users/slim0287/gists{/gist_id}","starred_url":"https://api.github.com/users/slim0287/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slim0287/subscriptions","organizations_url":"https://api.github.com/users/slim0287/orgs","repos_url":"https://api.github.com/users/slim0287/repos","events_url":"https://api.github.com/users/slim0287/events{/privacy}","received_events_url":"https://api.github.com/users/slim0287/received_events","type":"User","site_admin":false},"created_at":"2018-06-22T19:27:50Z","updated_at":"2018-06-22T19:27:50Z","author_association":"NONE","body":"@dpantel I hope someone has a better answer that I do:  when I made this error, I ended up reinstalling everything.  Operating system and Pihole.\r\n"}}
{"actor":{"display_login":"slim0287"}}