削除せずに起動時にプロセスの実行を停止します。

削除せずに起動時にプロセスの実行を停止します。

そのために、私は実行してpgrep postgres多くの結果を得ました。

postgres  1882     1  0 10:06 ?        00:00:00 /usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/9.3/main -c config_file=/etc/postgresql/9.3/main/postgresql.conf
postgres  1883     1  0 10:06 ?        00:00:00 /usr/lib/postgresql/9.4/bin/postgres -D /var/lib/postgresql/9.4/main -c config_file=/etc/postgresql/9.4/main/postgresql.conf
postgres  1943  1883  0 10:07 ?        00:00:00 postgres: checkpointer process                                                                                              
postgres  1944  1883  0 10:07 ?        00:00:00 postgres: writer process                                                                                                    
postgres  1945  1883  0 10:07 ?        00:00:00 postgres: wal writer process                                                                                                
postgres  1946  1883  0 10:07 ?        00:00:00 postgres: autovacuum launcher process                                                                                       
postgres  1947  1883  0 10:07 ?        00:00:00 postgres: stats collector process                                                                                           
postgres  1948  1882  0 10:07 ?        00:00:00 postgres: checkpointer process                                                                                              
postgres  1949  1882  0 10:07 ?        00:00:00 postgres: writer process                                                                                                    
postgres  1950  1882  0 10:07 ?        00:00:00 postgres: wal writer process                                                                                                
postgres  1951  1882  0 10:07 ?        00:00:00 postgres: autovacuum launcher process                                                                                       
postgres  1952  1882  0 10:07 ?        00:00:00 postgres: stats collector process                                                                                           

まず、postgres9.3と9.4が同時に実行されるようで、ちょっと変だと思いますが、それは別個の問題です。

sudo service postgres start必要に応じて起動できますが、起動時にPostgresを実行する必要はありません。しかし、9.4を始めたいです。

起動プロセスを更新する方法を見てみましたが、これを行うのは難しく簡単な方法はないようですが、通常は独自の起動スクリプトを作成するのが答えです。

最善の選択肢は何とか削除または切断するようですが、/etc/init.d/postgresこれを行う最善の方法はわかりません。私も/etc/rc{2,3,4,5}.d/SO3postgresql持っていますが、すべてスクリプトにリンクされているようですinit.d。起動時にスクリプト、特にpostgresが起動しないようにする最善の方法は何ですか?

ベストアンサー1

update-rc.d起動中にサービスのオンとオフを切り替えるために使用されます。

update-rc.d postgres remove

update-rc.d/etc/rcX.d ディレクトリ内のすべてのリンクを担当します。

注:これにより、/etc/init.dから起動スクリプトが削除されず、/etc/rcX.dディレクトリ内のすべてのリンクのみが削除されます。

バラよりupdate-rc.d のマニュアルページより多くの情報を知りたいです。

編集 私はあなたがUbuntuを使用していることを知らなかったので、それに対応するものを見つけました。

おすすめ記事