how to stop postgres server linux lsof code example Example: postgres stop linux sudo service postgresql stop sudo service postgresql start