postgres, ubuntu how to restart service on startup? get stuck on clustering after instance reboot

前端 未结 4 756
死守一世寂寞
死守一世寂寞 2021-01-30 15:45

I have a Postgres db 9.1 running on AWS EC2, with ubuntu 12.04.

I messed a lot with the instance (i.e installed all kinds of postg

相关标签:
4条回答
  • 2021-01-30 16:09

    I guess it would be best to fix the database startup script itself. But as a work around, you can add that line to /etc/rc.local, which is executed about last in init phase.

    0 讨论(0)
  • 2021-01-30 16:23

    The below command worked for me

    sudo service postgresql restart

    0 讨论(0)
  • 2021-01-30 16:24

    On Ubuntu 18.04:

    sudo systemctl restart postgresql.service

    0 讨论(0)
  • 2021-01-30 16:28

    ENABLE is what you are looking for

    USAGE: type this command once and then you are good to go. Your service will start automaticaly at boot up

     sudo systemctl enable postgresql
    

    DISABLE exists as well ofc

    Some DOC: freedesktop man systemctl

    0 讨论(0)
提交回复
热议问题