Bug 52112 - Не запускается сервис по умолчанию dnsdist
Summary: Не запускается сервис по умолчанию dnsdist
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: dnsdist (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Leontiy Volodin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-19 20:47 MSK by Evgeny Shesteperov
Modified: 2024-11-20 14:58 MSK (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evgeny Shesteperov 2024-11-19 20:47:21 MSK
Версия

-   dnsdist-1.9.7-alt2

Дистрибутивы

-   ALT Server 11.0 (Sisyphus)

Шаги воспроизведения

    # apt-get install -y dnsdist
    . . . . .
    useradd: не удалось сбросить запись в lastlog для UID 971: Нет такого файла или каталога
    . . . . .
    # systemctl stop bind
    # systemctl stop dnsmasq
    # systemctl stop systemd-resolved
    # cat > /etc/dnsdist/dnsdist.conf << 'EOF'
    addLocal("127.0.0.1:53")
    addLocal("::0:53")
    newServer({address="8.8.8.8", name="Google DNS", qps=10})
    newServer({address="1.1.1.1", name="Cloudflare DNS", qps=10})
    newServer({address="9.9.9.9", name="Quad9", qps=10})
    setServerPolicy(firstAvailable)
    EOF
    # systemctl enable --now dnsdist.service && sleep 5; systemctl status dnsdist.service --no-pager -l

Ожидаемый результат: успешно запущенный сервис

Фактический результат: activating (auto-restart)

    ● dnsdist.service - DNS Loadbalancer
         Loaded: loaded (/usr/lib/systemd/system/dnsdist.service; enabled; preset: disabled)
         Active: activating (auto-restart) (Result: exit-code) since Tue 2024-11-19 20:43:52 MSK; 635ms ago
           Docs: man:dnsdist(1)
                 https://dnsdist.org
        Process: 9709 ExecStartPre=/usr/bin/dnsdist -u dnsdist -g dnsdist --check-config (code=exited, status=1/FAILURE)
            CPU: 34ms

При этом конфигурация проходит все проверки и руками запускается:

    # /usr/bin/dnsdist -u dnsdist -g dnsdist --check-config
    Configuration '/etc/dnsdist/dnsdist.conf' OK!
    # dnsdist -C /etc/dnsdist/dnsdist.conf
    dnsdist 1.9.7 comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2
    Added downstream server 8.8.8.8:53
    Added downstream server 1.1.1.1:53
    Added downstream server 9.9.9.9:53
    Raised send buffer to 212992 for local address '127.0.0.1:53'
    Raised receive buffer to 212992 for local address '127.0.0.1:53'
    Listening on 127.0.0.1:53
    Raised send buffer to 212992 for local address '[::53]:53'
    Raised receive buffer to 212992 for local address '[::53]:53'
    Listening on [::53]:53
    ACL allowing queries from: 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.168.0.0/16, ::1/128, fc00::/7, fe80::/10
    Console ACL allowing connections from: 127.0.0.0/8, ::1/128
    Marking downstream Cloudflare DNS (1.1.1.1:53) as 'up'
    Marking downstream Google DNS (8.8.8.8:53) as 'up'
    Marking downstream Quad9 (9.9.9.9:53) as 'up'
    > Polled security status of version 1.9.7 at startup, no known issues reported: OK
Comment 1 Leontiy Volodin 2024-11-20 14:40:55 MSK
(Ответ для Evgeny Shesteperov на комментарий #0)
> Версия
> 
> -   dnsdist-1.9.7-alt2
> 
> Дистрибутивы
> 
> -   ALT Server 11.0 (Sisyphus)
> 
> Шаги воспроизведения
> 
>     # apt-get install -y dnsdist
>     . . . . .
>     useradd: не удалось сбросить запись в lastlog для UID 971: Нет такого
> файла или каталога

Это warning, который появляется при создании специального пользователя, если до этого его не было.
На работоспособность не влияет.

>     . . . . .
>     # systemctl stop bind
>     # systemctl stop dnsmasq
>     # systemctl stop systemd-resolved
>     # cat > /etc/dnsdist/dnsdist.conf << 'EOF'
>     addLocal("127.0.0.1:53")
>     addLocal("::0:53")
>     newServer({address="8.8.8.8", name="Google DNS", qps=10})
>     newServer({address="1.1.1.1", name="Cloudflare DNS", qps=10})
>     newServer({address="9.9.9.9", name="Quad9", qps=10})
>     setServerPolicy(firstAvailable)
>     EOF
>     # systemctl enable --now dnsdist.service && sleep 5; systemctl status
> dnsdist.service --no-pager -l
> 
> Ожидаемый результат: успешно запущенный сервис
> 
> Фактический результат: activating (auto-restart)
> 
>     ● dnsdist.service - DNS Loadbalancer
>          Loaded: loaded (/usr/lib/systemd/system/dnsdist.service; enabled;
> preset: disabled)
>          Active: activating (auto-restart) (Result: exit-code) since Tue
> 2024-11-19 20:43:52 MSK; 635ms ago
>            Docs: man:dnsdist(1)
>                  https://dnsdist.org
>         Process: 9709 ExecStartPre=/usr/bin/dnsdist -u dnsdist -g dnsdist
> --check-config (code=exited, status=1/FAILURE)
>             CPU: 34ms
> 

Причина была в невозможности прочитать /etc/dnsdist/dnsdist.conf.
Конфиг не читался из-за некорректных прав на него - исправил.
После исправления прав на конфиг сервис запускается успешно.

> При этом конфигурация проходит все проверки и руками запускается:
> 
>     # /usr/bin/dnsdist -u dnsdist -g dnsdist --check-config
>     Configuration '/etc/dnsdist/dnsdist.conf' OK!
>     # dnsdist -C /etc/dnsdist/dnsdist.conf
>     dnsdist 1.9.7 comes with ABSOLUTELY NO WARRANTY. This is free software,
> and you are welcome to redistribute it according to the terms of the GPL
> version 2
>     Added downstream server 8.8.8.8:53
>     Added downstream server 1.1.1.1:53
>     Added downstream server 9.9.9.9:53
>     Raised send buffer to 212992 for local address '127.0.0.1:53'
>     Raised receive buffer to 212992 for local address '127.0.0.1:53'
>     Listening on 127.0.0.1:53
>     Raised send buffer to 212992 for local address '[::53]:53'
>     Raised receive buffer to 212992 for local address '[::53]:53'
>     Listening on [::53]:53
>     ACL allowing queries from: 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8,
> 169.254.0.0/16, 172.16.0.0/12, 192.168.0.0/16, ::1/128, fc00::/7, fe80::/10
>     Console ACL allowing connections from: 127.0.0.0/8, ::1/128
>     Marking downstream Cloudflare DNS (1.1.1.1:53) as 'up'
>     Marking downstream Google DNS (8.8.8.8:53) as 'up'
>     Marking downstream Quad9 (9.9.9.9:53) as 'up'
>     > Polled security status of version 1.9.7 at startup, no known issues
> reported: OK
Comment 2 Repository Robot 2024-11-20 14:58:00 MSK
dnsdist-1.9.7-alt3 -> sisyphus:

 Wed Nov 20 2024 Leontiy Volodin <lvol@altlinux> 1.9.7-alt3
 - Fixed service startup (ALT #52112).