Bug 11425

Summary: Creating default database fail on empty /var/lib/pgsql-root/var/lib/pgsql/data
Product: Sisyphus Reporter: enp <enp>
Component: postgresql8.2-serverAssignee: Ivan Fedorov <ns>
Status: CLOSED DUPLICATE QA Contact: qa-sisyphus
Severity: normal    
Priority: P2 CC: misha, mithraen, thresh, vvk
Version: unstable   
Hardware: all   
OS: Linux   

Description enp 2007-04-09 13:41:07 MSD
После dist-upgrade и очистки /var/lib/pgsql-root/var/lib/pgsql/data:

# service postgresql start
Adjusting environment for postgresql:                                          
                                                       [ DONE ]
Creating default database: /bin/su: unrecognized option
`--pgdata=/var/lib/pgsql-root/var/lib/pgsql/data'
usage: su [-|-l] [-c "command"] [-s "shell"] [username]
                                                                               
                                                       [FAILED]

При запуске с bash -x вижу такое:

+ echo -n 'Creating default database: '
Creating default database: + initlog -q -c '/bin/su -s /bin/sh -l postgres -c
/usr/bin/initdb --pgdata="/var/lib/pgsql-root/var/lib/pgsql/data"'
/bin/su: unrecognized option `--pgdata=/var/lib/pgsql-root/var/lib/pgsql/data'
usage: su [-|-l] [-c "command"] [-s "shell"] [username]

При этом:

# grep initdb /etc/init.d/postgresql      
                echo "export LANG LC_ALL LC_CTYPE LC_COLLATE LC_NUMERIC LC_CTYPE
LC_TIME" >> "$PG_CHROOT_DIR$PGDATA/../initdb.i18n"
                action "Creating default database:" /bin/su -s /bin/sh -l
postgres -c "/usr/bin/initdb --pgdata=\"$PG_CHROOT_DIR$PGDATA\""

Куда девался " перед /usr/bin/initdb?
Comment 1 Ivan Fedorov 2007-04-17 20:54:46 MSD

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