Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/zabbix: fix initial database creation #45750

Merged
merged 2 commits into from Aug 30, 2018
Merged

Conversation

johannesloetzsch
Copy link
Contributor

without this fix the database setup fails with „could not connect to database postgres: FATAL: role "root" does not exist“

without this fix the database setup fails with „could not connect to database postgres: FATAL:  role "root" does not exist“
@@ -103,8 +103,8 @@ in
chown zabbix ${stateDir} ${logDir} ${libDir}

if ! test -e "${libDir}/db-created"; then
${pkgs.postgresql}/bin/createuser --no-superuser --no-createdb --no-createrole zabbix || true
${pkgs.postgresql}/bin/createdb --owner zabbix zabbix || true
${pkgs.sudo}/bin/sudo -u ${config.services.postgresql.superUser} ${pkgs.postgresql}/bin/createuser --no-superuser --no-createdb --no-createrole zabbix || true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

su is a bit more lightweight then sudo:

${pkgs.su}/bin/su -l ${config.services.postgresql.superUser}

@Mic92 Mic92 changed the title fix zabbix-server-pre-start nixos/zabbix: fix initial database creation Aug 30, 2018
@Mic92 Mic92 merged commit bb08d1c into NixOS:master Aug 30, 2018
@Mic92
Copy link
Member

Mic92 commented Aug 30, 2018

Is a backport required here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants