postgresql隨機啟動設定

panpong發表於2017-02-03

PG隨機啟動設定

如果是原始碼安裝則首選參考原始碼包中的:../postgresql-9.4.1/contrib/start-scripts檔案;

將對應檔案更名為:/etc/init.d/postgresql (or# /etc/rc.d/init.d/postgresql)

並且make symlinks to

#   /etc/rc.d/rc0.d/K02postgresql

#   /etc/rc.d/rc1.d/K02postgresql

#   /etc/rc.d/rc2.d/K02postgresql

#   /etc/rc.d/rc3.d/S98postgresql

#   /etc/rc.d/rc4.d/S98postgresql

#   /etc/rc.d/rc5.d/S98postgresql

# Or, if you have chkconfig, simply:

 chkconfig --add postgresql

 

其次,編輯/etc/rc.local檔案,新增pg_ctl start -D $PGDATA -l logfile

如果是rpm安裝,則僅需要配置chkconfig:
#chkconfig postgresql on

#systemctl enable postgresql --linux 7

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/16976507/viewspace-2133043/,如需轉載,請註明出處,否則將追究法律責任。

相關文章