Não é possível iniciar o postgresql

1

Sempre que tentar iniciar postgresql , no entanto, falhará. Estou executando o Kali NetHunter.

Aqui está minha saída de terminal

root@kali:~# service postgresql start
[....] Starting PostgreSQL 10 database server: main[....] Error: /usr/lib/postgresql/10/bin/pg_ctl /usr/lib/postgresql/10/bin/pg_ctl start -D /var/lib/postgresql/10/main -l /var/log/postgresql/postgresql-10-main.log -s -o -c config_file="/etc/postgresql/10/main/postgresql.conf" exited with status 1: 2018-02-07 09:29:59.653 UTC 0 LOG: listening on IPv6 address "::1", port 5432 2018-02-07 09:29:59.653 UTC 0 LOG: listening on IPv4 address "127.0.0.1", port 5432 2018-02-07 09:29:59.654 UTC 0 LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2018-02-07 09:29:59.656 UTC 0 FATAL: could not create shared memory segment: Function not implemented 2018-02-07 09:29:59.656 UTC 0 DETAIL: Failed system call was shmget(key=5432001, size=40, 03600). 2018-02-07 09:29:59.656 UTC 0 LOG: database system is shut down pg_ctl: could not start [FAILr Examine the log output. ... failed!
 failed!

E aqui está o arquivo de log

2018-02-06 16:31:36.775 UTC [6358] LOG:  listening on IPv6 address "::1", port 5432
2018-02-06 16:31:36.775 UTC [6358] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-06 16:31:36.783 UTC [6358] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-06 16:31:36.785 UTC [6358] FATAL:  could not create shared memory segment: Function not implemented
2018-02-06 16:31:36.785 UTC [6358] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-06 16:31:36.785 UTC [6358] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
2018-02-06 16:57:52.984 UTC [8837] LOG:  listening on IPv6 address "::1", port 5432
2018-02-06 16:57:52.984 UTC [8837] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-06 16:57:52.985 UTC [8837] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-06 16:57:52.988 UTC [8837] FATAL:  could not create shared memory segment: Function not implemented
2018-02-06 16:57:52.988 UTC [8837] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-06 16:57:52.988 UTC [8837] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
2018-02-06 16:57:53.693 UTC [8875] LOG:  listening on IPv6 address "::1", port 5432
2018-02-06 16:57:53.693 UTC [8875] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-06 16:57:53.694 UTC [8875] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-06 16:57:53.695 UTC [8875] FATAL:  could not create shared memory segment: Function not implemented
2018-02-06 16:57:53.695 UTC [8875] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-06 16:57:53.696 UTC [8875] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
2018-02-07 02:57:25.787 UTC [15672] LOG:  listening on IPv6 address "::1", port 5432
2018-02-07 02:57:25.788 UTC [15672] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-07 02:57:25.788 UTC [15672] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-07 02:57:25.790 UTC [15672] FATAL:  could not create shared memory segment: Function not implemented
2018-02-07 02:57:25.790 UTC [15672] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-07 02:57:25.791 UTC [15672] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
2018-02-07 03:13:39.986 UTC [17336] LOG:  listening on IPv6 address "::1", port 5432
2018-02-07 03:13:39.987 UTC [17336] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-07 03:13:39.988 UTC [17336] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-07 03:13:39.989 UTC [17336] FATAL:  could not create shared memory segment: Function not implemented
2018-02-07 03:13:39.989 UTC [17336] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-07 03:13:39.989 UTC [17336] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
2018-02-07 06:26:52.218 UTC [32350] LOG:  listening on IPv6 address "::1", port 5432
2018-02-07 06:26:52.219 UTC [32350] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-07 06:26:52.219 UTC [32350] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-07 06:26:52.221 UTC [32350] FATAL:  could not create shared memory segment: Function not implemented
2018-02-07 06:26:52.221 UTC [32350] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-07 06:26:52.222 UTC [32350] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
2018-02-07 09:29:59.653 UTC [10136] LOG:  listening on IPv6 address "::1", port 5432
2018-02-07 09:29:59.653 UTC [10136] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-07 09:29:59.654 UTC [10136] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-07 09:29:59.656 UTC [10136] FATAL:  could not create shared memory segment: Function not implemented
2018-02-07 09:29:59.656 UTC [10136] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-07 09:29:59.656 UTC [10136] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
    
por Krishna Deshpande KD 07.02.2018 / 10:55

1 resposta

5

postgresql não está ativo porque não pode criar um segmento de memória compartilhada grande o suficiente, conforme visto pelo erro:

could not create shared memory segment: Function not implemented
Failed system call was shmget

Para corrigir isso, faça:

sudo sysctl -w kernel.shmmax=134217728

Para defini-lo permanentemente após as reinicializações, edite /etc/sysctl.conf e anexe a ele o kernel.shmmax = 134217728 :

sudo vi /etc/sysctl.conf
kernel.shmmax = 134217728

ATUALIZAÇÃO para a resposta:

Depurando com a ajuda do OP:

sudo sysctl -w kernel.shmmax=134217728 sysctl: cannot stat /proc/sys/kernel/shmmax: No such file or directory

Isso uniu que o Kali NetHunter é para dispositivos Android, a resposta mais correta e definitiva é que shmem support não foi compilado nesta versão do kernel.

Isso também limita a impossibilidade de executar outro software que tenha shmem como Apache .

Infelizmente, também pode não fazer muito sentido executar um banco de dados postgresql em dispositivos Android de classe.

No entanto, um possível curso de ação é tentar encontrar outro pacote do kernel (se houver), que suporta shmem, ou no limite de compilação cruzada de um kernel. Obviamente, você não deve considerar esta rota é o seu dispositivo é muito baixo em disco e / ou memória.

    
por 07.02.2018 / 11:36