起動しようとするたびにpostgresql
失敗します。私はKali NetHunterを実行しています。
これは私の端末出力です
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!
これはログファイルです
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.
答え1
postgresql
エラー状態など、十分に大きな共有メモリセグメントを作成できないため起動しません。
could not create shared memory segment: Function not implemented
Failed system call was shmget
この問題を解決するには、次の手順を実行します。
sudo sysctl -w kernel.shmmax=134217728
再起動後に恒久的に設定するには、/etc/sysctl.conf
以下を編集して追加しますkernel.shmmax = 134217728
。
sudo vi /etc/sysctl.conf
kernel.shmmax = 134217728
更新された回答:
OPヘルプによるデバッグ:
sudo sysctl -w kernel.shmmax=134217728 sysctl: cannot stat /proc/sys/kernel/shmmax: No such file or directory
Kali NetHunterがAndroidデバイスで利用可能であることを考慮すると、最も正確で明確な答えは、shmem
このカーネルバージョンではサポートがコンパイルされないことです。
これはまたshmem
。Apache
残念ながら、Androidに似たデバイスでpostgresqlデータベースを実行することはあまり意味がありません。
それにもかかわらず、1つの可能性は、shmemをサポートする他のカーネルパッケージ(存在する場合)を見つけるか、極端な場合はカーネルをクロスコンパイルすることです。もちろん、デバイスのディスクやメモリが不足している場合は、このパスを考慮しないでください。