macOSで再起動後に自動起動設定済みのPostgreSQLが起動しなくなった。
- macOS 10.12.3
- PostgreSQL 9.6.2
PostgreSQLはbrew経由でインストールしています。
brew services list
で確認すると、started
というステータスなのにプロセスが確認できない状態でした。
そこで、以下のコマンドで起動するとpid
ファイルが残っているというエラーメッセージが出ました。
kntmrkm:~/Library/LaunchAgents $ postgres -D /usr/local/var/postgres
FATAL: lock file "postmaster.pid" already exists
HINT: Is another postmaster (PID 510) running in data directory "/usr/local/var/postgres"?
pid
ファイルを削除すると無事起動することができました。