Service startup mode
# For example, if you are want to change the server's port number to 5433,
# Create a file named "/etc/systemd/system/postgresql.service" containing:
#. Include/lib/systemd/system/postgresql.service
# [Service]
# environment=pgport=5433
# This would override the setting appearing below.
sudo vim/etc/systemd/system/postgresql.service
According to this official explanation after the change, found that ....
It doesn't work at all. It started with 5432.
Just change it. Egg aches
sudo vim/lib/systemd/system/postgresql.service
Then reload
sudo systemctl daemon-reload
So....
It's not starting up.
Postgresql.service-postgresql Database Server
Loaded:loaded (/etc/systemd/system/postgresql.service; enabled)
Active:failed (Result:exit-code) since II 2015-03-03 19:06:19 CST; 9s ago
process:8305 execstop=/usr/bin/pg_ctl stop-d ${pgdata}-s-m Fast (code=exited, status=0/success)
process:8359 execstart=/usr/bin/pg_ctl start-d ${pgdata}-s-o-P ${pgport}-w-t (code=exited, Status=1/FAILURE)
process:8353 Execstartpre=/usr/bin/postgresql-check-db-dir ${pgdata} (code=exited, Status=0/SUCCESS)
Main pid:32289 (code=exited, status=0/success)
It's not a sore egg, it's a broken egg.
Change back, or start not. It is estimated that the files under/etc will be added again after the reload
Well, then I'll put/etc ... File port, change it back.
So it can be started. Nima!!
No, I'll start with the original way.
pg_ctl-d/var/lib/pgsql/data-p 5433-l logfile Start