Pi-hole installieren auf Debian 11

Warum Debian und/oder eine seiner Spielarten? Was muss ich vorher wissen? Wo geht es nach der Installation weiter?
Antworten
Jetix
Beiträge: 99
Registriert: 13.07.2021 18:26:23

Pi-hole installieren auf Debian 11

Beitrag von Jetix » 24.02.2022 11:10:34

ich habe laut dieser Anleitung hier: https://unixcop.com/deploy-pihole-debian/#comment-5896
versucht pi-hole zu installieren.
Ab dem Punkt: sh docker_run.sh
bekomme ich Fehlermeldungen:

Code: Alles auswählen

~/docker-pi-hole$ sh docker_run.sh
docker_run.sh: 6: [[: not found
docker_run.sh: 9: docker: not found
Starting up pihole container docker_run.sh: 26: docker: not found
docker_run.sh: 26: [: unexpected operator
.docker_run.sh: 26: docker: not found
docker_run.sh: 26: [: unexpected operator
der Rest funktioniert sowieso nicht mehr.
Hat jemand Erfahrungen damit?

Benutzeravatar
MSfree
Beiträge: 11710
Registriert: 25.09.2007 19:59:30

Re: Pi-hole installieren auf Debian 11

Beitrag von MSfree » 24.02.2022 11:17:11

Ist
Jetix hat geschrieben: ↑ zum Beitrag ↑
24.02.2022 11:10:34

Code: Alles auswählen

docker_run.sh: 9: docker: not found
nicht deutlich genug?

Nochmal:

docker: not found

reox
Beiträge: 2554
Registriert: 06.06.2006 22:09:47
Lizenz eigener Beiträge: MIT Lizenz

Re: Pi-hole installieren auf Debian 11

Beitrag von reox » 24.02.2022 14:45:07

Das Problem tritt aber auch schon vorher auf, da ein bash script mit sh gestartet wird und deshalb [[ nicht gefunden wird.
Das shell script selber hat ja sogar #!/bin/bash drin stehen, also warum nicht chmod u+x und ./docker_run.sh?

DeletedUserReAsG

Re: Pi-hole installieren auf Debian 11

Beitrag von DeletedUserReAsG » 24.02.2022 15:38:20

Guck halt mal die erste Zeile an, ob da nicht sowas wie #! /bin/bash oder so drinsteht, und versuche, die dort stehende Shell zu nutzen. Ich halte es für möglich, dass bei Debian sh immer noch ein Link auf dash ist, und dass diese das Kostrukt nicht kennt. Sicher bin ich mir allerdings nicht – müsste ich nachschauen, da kannst du auch genausogut selbst nachschauen :)

JTH
Moderator
Beiträge: 3081
Registriert: 13.08.2008 17:01:41
Wohnort: Berlin

Re: Pi-hole installieren auf Debian 11

Beitrag von JTH » 24.02.2022 16:02:06

niemand hat geschrieben: ↑ zum Beitrag ↑
24.02.2022 15:38:20
Ich halte es für möglich, dass bei Debian sh immer noch ein Link auf dash ist, und dass diese das Kostrukt nicht kennt.
Yep, von Haus aus ist das der Fall.
Manchmal bekannt als Just (another) Terminal Hacker.

Jetix
Beiträge: 99
Registriert: 13.07.2021 18:26:23

Re: Pi-hole installieren auf Debian 11

Beitrag von Jetix » 24.02.2022 17:19:02

nun, Docker habe ich wohl übersehen, danke!
habe es installiert. aber:

Code: Alles auswählen

docker-pi-hole$ sudo sh docker_run.sh
docker_run.sh: 6: [[: not found
docker: Error response from daemon: Conflict. The container name "/pihole" is already in use by container "9c2ff656d669f27182353f7040ac6c3ea2fd2da0ec5b2ff5c86b1f72571a8601". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
Starting up pihole container Template parsing error: template: :1:8: executing "" at <.State.Health.Status>: map has no entry for key "Health"
docker_run.sh: 26: [: unexpected operator
.Template parsing error: template: :1:8: executing "" at <.State.Health.Status>: map has no entry for key "Health"
docker_run.sh: 26: [: unexpected operator
.Template parsing error: template: :1:8: executing "" at <.State.Health.Status>: map has no entry for key "Health"
docker_run.sh: 26: [: unexpected operator
.Template parsing error: template: :1:8: executing "" at <.State.Health.Status>: map has no entry for key "Health"
docker_run.sh: 26: [: unexpected operator
^C
DNS IP habe ich auch vom Vodafone in der Datei docker_run.sh (und im Router angepasst)

JTH
Moderator
Beiträge: 3081
Registriert: 13.08.2008 17:01:41
Wohnort: Berlin

Re: Pi-hole installieren auf Debian 11

Beitrag von JTH » 24.02.2022 17:34:39

Jetix hat geschrieben: ↑ zum Beitrag ↑
24.02.2022 17:19:02
aber:
Hast du beachtet, was niemand dir geantwortet hat?
niemand hat geschrieben: ↑ zum Beitrag ↑
24.02.2022 15:38:20
Guck halt mal die erste Zeile an, ob da nicht sowas wie #! /bin/bash oder so drinsteht, und versuche, die dort stehende Shell zu nutzen.
shbash (zumindest nicht zwangsläufig).
Manchmal bekannt als Just (another) Terminal Hacker.

Jetix
Beiträge: 99
Registriert: 13.07.2021 18:26:23

Re: Pi-hole installieren auf Debian 11

Beitrag von Jetix » 24.02.2022 17:40:09

ach so, ich dachte das betrifft erst mal nur den Docker,
nun soll ich den #!/bin/bash
löschen?

JTH
Moderator
Beiträge: 3081
Registriert: 13.08.2008 17:01:41
Wohnort: Berlin

Re: Pi-hole installieren auf Debian 11

Beitrag von JTH » 24.02.2022 17:43:19

Nein. Entweder das Ganze mit bash, statt sh davor aufrufen. Oder das Skript ausführbar machen und dann direkt als

Code: Alles auswählen

./docker_run.sh
ausführen.
Manchmal bekannt als Just (another) Terminal Hacker.

Jetix
Beiträge: 99
Registriert: 13.07.2021 18:26:23

Re: Pi-hole installieren auf Debian 11

Beitrag von Jetix » 24.02.2022 17:50:50

nun, gleiche Fehlermeldung:

Code: Alles auswählen

commodore@pc64:~/docker-pi-hole$ chmod u+x ./docker_run.sh
commodore@pc64:~/docker-pi-hole$ ./docker_run.sh
docker: Error response from daemon: Conflict. The container name "/pihole" is already in use by container "9c2ff656d669f27182353f7040ac6c3ea2fd2da0ec5b2ff5c86b1f72571a8601". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
Starting up pihole container Template parsing error: template: :1:8: executing "" at <.State.Health.Status>: map has no entry for key "Health"
.Template parsing error: template: :1:8: executing "" at <.State.Health.Status>: map has no entry for key "Health"
.Template parsing error: template: :1:8: executing "" at <.State.Health.Status>: map has no entry for key "Health"
^C

DeletedUserReAsG

Re: Pi-hole installieren auf Debian 11

Beitrag von DeletedUserReAsG » 24.02.2022 17:54:05

Jetix hat geschrieben: ↑ zum Beitrag ↑
24.02.2022 17:50:50
nun, gleiche Fehlermeldung:
Ähm … nein! Man muss so Meldungen schon auch lesen!

Ein Fehler ist weg, nun wirst du dich um die verbleibenden Fehler kümmern müssen. Und der nächste zu bearbeitende Fehler steht gar ebenfalls im Klartext da: es gibt bereits eine Instanz mit dem Container. Wie gesagt: die Meldungen sind zum Lesen da, nicht nur fancy Deko, um wie’n Häcker zu wirken.

Jetix
Beiträge: 99
Registriert: 13.07.2021 18:26:23

Re: Pi-hole installieren auf Debian 11

Beitrag von Jetix » 24.02.2022 18:01:15

das ist klar, ich finde da keine Möglichkeit den Container zu löschen/umbenennen (welche dieser auch sei: ob: 9c2ff656d669f27182353f7040ac6c3ea2fd2da0ec5b2ff5c86b1f72571a8601
oder: /pihole
unter: docker run --help

Code: Alles auswählen

$ docker run --help

Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container

Options:
      --add-host list                  Add a custom host-to-IP mapping (host:ip)
  -a, --attach list                    Attach to STDIN, STDOUT or STDERR
      --blkio-weight uint16            Block IO (relative weight), between 10 and 1000, or 0
                                       to disable (default 0)
      --blkio-weight-device list       Block IO weight (relative device weight) (default [])
      --cap-add list                   Add Linux capabilities
      --cap-drop list                  Drop Linux capabilities
      --cgroup-parent string           Optional parent cgroup for the container
      --cgroupns string                Cgroup namespace to use (host|private)
                                       'host':    Run the container in the Docker host's
                                       cgroup namespace
                                       'private': Run the container in its own private cgroup
                                       namespace
                                       '':        Use the cgroup namespace as configured by
                                       the
                                                  default-cgroupns-mode option on the daemon
                                       (default)
      --cidfile string                 Write the container ID to the file
      --cpu-period int                 Limit CPU CFS (Completely Fair Scheduler) period
      --cpu-quota int                  Limit CPU CFS (Completely Fair Scheduler) quota
      --cpu-rt-period int              Limit CPU real-time period in microseconds
      --cpu-rt-runtime int             Limit CPU real-time runtime in microseconds
  -c, --cpu-shares int                 CPU shares (relative weight)
      --cpus decimal                   Number of CPUs
      --cpuset-cpus string             CPUs in which to allow execution (0-3, 0,1)
      --cpuset-mems string             MEMs in which to allow execution (0-3, 0,1)
  -d, --detach                         Run container in background and print container ID
      --detach-keys string             Override the key sequence for detaching a container
      --device list                    Add a host device to the container
      --device-cgroup-rule list        Add a rule to the cgroup allowed devices list
      --device-read-bps list           Limit read rate (bytes per second) from a device
                                       (default [])
      --device-read-iops list          Limit read rate (IO per second) from a device (default [])
      --device-write-bps list          Limit write rate (bytes per second) to a device
                                       (default [])
      --device-write-iops list         Limit write rate (IO per second) to a device (default [])
      --disable-content-trust          Skip image verification (default true)
      --dns list                       Set custom DNS servers
      --dns-option list                Set DNS options
      --dns-search list                Set custom DNS search domains
      --domainname string              Container NIS domain name
      --entrypoint string              Overwrite the default ENTRYPOINT of the image
  -e, --env list                       Set environment variables
      --env-file list                  Read in a file of environment variables
      --expose list                    Expose a port or a range of ports
      --gpus gpu-request               GPU devices to add to the container ('all' to pass all
                                       GPUs)
      --group-add list                 Add additional groups to join
      --health-cmd string              Command to run to check health
      --health-interval duration       Time between running the check (ms|s|m|h) (default 0s)
      --health-retries int             Consecutive failures needed to report unhealthy
      --health-start-period duration   Start period for the container to initialize before
                                       starting health-retries countdown (ms|s|m|h) (default 0s)
      --health-timeout duration        Maximum time to allow one check to run (ms|s|m|h)
                                       (default 0s)
      --help                           Print usage
  -h, --hostname string                Container host name
      --init                           Run an init inside the container that forwards signals
                                       and reaps processes
  -i, --interactive                    Keep STDIN open even if not attached
      --ip string                      IPv4 address (e.g., 172.30.100.104)
      --ip6 string                     IPv6 address (e.g., 2001:db8::33)
      --ipc string                     IPC mode to use
      --isolation string               Container isolation technology
      --kernel-memory bytes            Kernel memory limit
  -l, --label list                     Set meta data on a container
      --label-file list                Read in a line delimited file of labels
      --link list                      Add link to another container
      --link-local-ip list             Container IPv4/IPv6 link-local addresses
      --log-driver string              Logging driver for the container
      --log-opt list                   Log driver options
      --mac-address string             Container MAC address (e.g., 92:d0:c6:0a:29:33)
  -m, --memory bytes                   Memory limit
      --memory-reservation bytes       Memory soft limit
      --memory-swap bytes              Swap limit equal to memory plus swap: '-1' to enable
                                       unlimited swap
      --memory-swappiness int          Tune container memory swappiness (0 to 100) (default -1)
      --mount mount                    Attach a filesystem mount to the container
      --name string                    Assign a name to the container
      --network network                Connect a container to a network
      --network-alias list             Add network-scoped alias for the container
      --no-healthcheck                 Disable any container-specified HEALTHCHECK
      --oom-kill-disable               Disable OOM Killer
      --oom-score-adj int              Tune host's OOM preferences (-1000 to 1000)
      --pid string                     PID namespace to use
      --pids-limit int                 Tune container pids limit (set -1 for unlimited)
      --platform string                Set platform if server is multi-platform capable
      --privileged                     Give extended privileges to this container
  -p, --publish list                   Publish a container's port(s) to the host
  -P, --publish-all                    Publish all exposed ports to random ports
      --pull string                    Pull image before running ("always"|"missing"|"never")
                                       (default "missing")
      --read-only                      Mount the container's root filesystem as read only
      --restart string                 Restart policy to apply when a container exits
                                       (default "no")
      --rm                             Automatically remove the container when it exits
      --runtime string                 Runtime to use for this container
      --security-opt list              Security Options
      --shm-size bytes                 Size of /dev/shm
      --sig-proxy                      Proxy received signals to the process (default true)
      --stop-signal string             Signal to stop a container (default "SIGTERM")
      --stop-timeout int               Timeout (in seconds) to stop a container
      --storage-opt list               Storage driver options for the container
      --sysctl map                     Sysctl options (default map[])
      --tmpfs list                     Mount a tmpfs directory
  -t, --tty                            Allocate a pseudo-TTY
      --ulimit ulimit                  Ulimit options (default [])
  -u, --user string                    Username or UID (format: <name|uid>[:<group|gid>])
      --userns string                  User namespace to use
      --uts string                     UTS namespace to use
  -v, --volume list                    Bind mount a volume
      --volume-driver string           Optional volume driver for the container
      --volumes-from list              Mount volumes from the specified container(s)
  -w, --workdir string                 Working directory inside the container

DeletedUserReAsG

Re: Pi-hole installieren auf Debian 11

Beitrag von DeletedUserReAsG » 24.02.2022 18:03:55

Jetix hat geschrieben: ↑ zum Beitrag ↑
24.02.2022 18:01:15
unter: docker run --help
Könntest du dir bitte angewöhnen, die von dir produzierten Ausgaben selbst zu lesen? Du musst hier die Ausgabe der Hilfefunktion nicht posten – wen’s interessiert, der kann da selbst nachgucken, oder direkt die Manpage aufrufen. Du musst es lesen, um die richtige Option rauszusuchen und zu verwenden.

Jetix
Beiträge: 99
Registriert: 13.07.2021 18:26:23

Re: Pi-hole installieren auf Debian 11

Beitrag von Jetix » 24.02.2022 18:15:01

nun,
mit: docker rm 9c2ff656d669f27182353f7040ac6c3ea2fd2da0ec5b2ff5c86b1f72571a8601
habe ich den container gelöscht.
danach habe ich ./docker_run.sh neugestartet, automatisch neuen Container bekommen, wieder eine andere Fehlermeldung dieses mal:

Code: Alles auswählen

~/docker-pi-hole$ ./docker_run.sh
c2b9a5b0c85da130f7a60ae48cec0797ad055115b1f8fbb57665ad3b5b7e1bb4
docker: Error response from daemon: driver failed programming external connectivity on endpoint pihole (553496392e8ce63b34bb60c59661ce864b5ddde07993a8578b7966bc364255bf): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use.
Starting up pihole container Template parsing error: template: :1:8: executing "" at <.State.Health.Status>: map has no entry for key "Health"
.Template parsing error: template: :1:8: executing "" at <.State.Health.Status>: map has no entry for key "Health"
.Template parsing error: template: :1:8: executing "" at <.State.Health.Status>: map has no entry for key "Health"
.Template parsing error: template: :1:8: executing "" at <.State.Health.Status>: map has no entry for key "Health"
^C
ausser das hier eine Adresse bereits in Benutzung ist habe ich nichts verstanden, und was für eine Adresse das sein soll ist mir Unklar.

DeletedUserReAsG

Re: Pi-hole installieren auf Debian 11

Beitrag von DeletedUserReAsG » 24.02.2022 18:17:36

Jetix hat geschrieben: ↑ zum Beitrag ↑
24.02.2022 18:15:01

Code: Alles auswählen

Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use.
Ist doch schon wieder Klartext: auf dem betreffenden Rechner läuft etwas, das an Port 80 hängt. Was es ist, lässt sich mit beispielsweise ss in Erfahrung bringen – die dazu nötigen Optionen liest du bitte selbst nach (man ss), oder du wartest, bis jemand Lust hat, es dir copypastafähig hier hinzuschreiben.

Jetix
Beiträge: 99
Registriert: 13.07.2021 18:26:23

Re: Pi-hole installieren auf Debian 11

Beitrag von Jetix » 24.02.2022 18:45:22

ich habe einfach port 80:80 in der docker_run.sh Datei auf 70:70 geändert.

Code: Alles auswählen

commodore@pc64:~/docker-pi-hole$ ./docker_run.sh
6951bff940b5db3743587b4667bc4e6042c62493ce124ea19408caaef4cc1797
Starting up pihole container .......... OK
Assigning random password: XXXXXX for your pi-hole: https:///admin/
über den Browser: 127.0.0.1/admin oder https:///admin/ führt zur 404, oder Seite nicht gefunden

DeletedUserReAsG

Re: Pi-hole installieren auf Debian 11

Beitrag von DeletedUserReAsG » 24.02.2022 18:47:30

Jetix hat geschrieben: ↑ zum Beitrag ↑
24.02.2022 18:45:22
ich habe einfach port 80:80 in der docker_run.sh Datei auf 70:70 geändert.
[…]
über den Browser: 127.0.0.1/admin oder https:///admin/ führt zur 404, oder Seite nicht gefunden
Wenn du den Port auf 70 änderst, wirst du die Seite auch von Port 70 abrufen müssen …

Jetix
Beiträge: 99
Registriert: 13.07.2021 18:26:23

Re: Pi-hole installieren auf Debian 11

Beitrag von Jetix » 24.02.2022 19:44:52

ich gebe es auf, ich habe alles mögliche ausprobiert, auch später normalen port: 80 hergenommen (diesmal kam keine Fehlermeldung das dieser besetz sei)
es kommt immer: 404

DeletedUserReAsG

Re: Pi-hole installieren auf Debian 11

Beitrag von DeletedUserReAsG » 24.02.2022 19:55:24

Und du hast nicht in Erwägung gezogen, mittels beispielsweise ss zu schauen, ob da alles richtig ist? Erstaunlich.

Ich geb’s aber nun auch auf: der Top-Down-Ansatz funktioniert hier nicht, hier wäre erstmal ein grundlegendes Verständnis der Materie allgemein vonnöten (was ist ’ne Shell, was ist Docker, was sind Scripte, was hat es mit IPs und Ports aufsich, usw. usf.).

Und eine nicht gar so kaputte „Anleitung“.

Jetix
Beiträge: 99
Registriert: 13.07.2021 18:26:23

Re: Pi-hole installieren auf Debian 11

Beitrag von Jetix » 24.02.2022 20:08:47

natürlich mittels ss fand ich einiges heraus, ich habe auch als letztes den Port 443 ausprobiert
127.0.0.1:80/admin
127.0.0.1:70/admin
127.0.0.1:443/admin
............ usw
laut der Anleitung aber soll ich die externe IP nehmen:
92.76.xxx.xxx/admin

was mich auch nicht weiter gebracht hat, ich schaue ob es bessere Anleitungen dazu gibt

(man muss auch jedesmal wenn man irgendetwas in der Datei was ändert, danach Docker stoppen, Docker löschen, Docker neustarten)

Antworten