[Slackbuilds-users] PostgreSQL init script stop/restart options
Adis Nezirovic
adis at linux.org.ba
Sun May 31 19:48:53 UTC 2009
Hello,
Last week I've had interesing suggestion for PostgreSQL init script.
The main issue is that pg_ctl, utility that starts Postgres, has three
modes of operation:
---
Three different shutdown methods can be selected with the -m option:
- "Smart" mode waits for all the clients to disconnect. This is the
default.
- "Fast" mode does not wait for clients to disconnect. All active
transactions are rolled back and clients are forcibly disconnected,
then the server is shut down.
- "Immediate" mode will abort all server processes without a clean
shutdown. This will lead to a recovery run on restart.
---
Current init script uses explicit '-m smart' option. And for users it
looks like this:
/etc/rc.d/rc.postgres {stop|restart}
Sometimes, one needs to force server restart, (e.g PHP script gone bad,
and it uses persistent connections) but "smart" option doesn't want to
kill active connections.)
Anyway, my first idea was to use something like this
/etc/rc.d/rc.postgres {stop|restart} [smart|fast|immediate]
(smart is the default and can be ommited)
It's somewhat strange syntax for init script, but other options should
be used only for extreme situations, especially immediate).
Other proposal would be:
/etc/rc.d/rc.postgres {restart|force-restart|unclean-restart}
/etc/rc.d/rc.postgres {stop|force-stop|unclean-stop}
What do you think, what's the proper way to treat "advanced" init script
actions?
Best regards,
Adis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20090531/c23125c5/attachment.sig>
More information about the SlackBuilds-users
mailing list