Bug 47883 - Переменная PGMETHOD в /etc/init.d/postgresql для условия по умолчанию не задана
Summary: Переменная PGMETHOD в /etc/init.d/postgresql для условия по умолчанию не задана
Status: CLOSED DUPLICATE of bug 47838
Alias: None
Product: Sisyphus
Classification: Development
Component: postgresql13 (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Alexei Takaseev
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-08 19:09 MSK by Evgeny Shesteperov
Modified: 2023-10-09 10:25 MSK (History)
11 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evgeny Shesteperov 2023-10-08 19:09:30 MSK
Версия

-   postgresql13-server-13.12-alt3

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

    # apt-get install -y postgresql13-server
    # sed -i "/PGMETHOD/d" /etc/sysconfig/postgresql
    # /etc/init.d/postgresql initdb

Ожидаемый результат: инициализация БД

Фактический результат: ошибка, потому что подставляется пустая
переменная $PGMETHOD

    Creating default database:
    initdb: ошибка: нераспознанный метод проверки подлинности "-W" для подключений "local"

Откладка

    # apt-get install -y postgresql13-server
    # grep 'PGMETHOD' /etc/init.d/postgresql
        if [ -z "PGMETHOD" ]
            PGMETHOD="scram-sha-256"
        su -s /bin/sh -l postgres -c "initdb  --pgdata=\"$PGDATA\" --locale=\"$PGLOCALE\" -A $PGMETHOD -W"

или более наглядно:

    # apt-get install -y postgresql13-server
    # bash -x /etc/init.d/postgresql initdb
    . . . . .
    + '[' -z PGMETHOD ']'
    . . . . .

Должно быть:

    - if [ -z "PGMETHOD" ]
    + if [ -z "${PGMETHOD}" ]
Comment 1 Alexei Takaseev 2023-10-09 10:25:07 MSK

*** This bug has been marked as a duplicate of bug 47838 ***