The behavior I'm considering is:
if pg_ctl status returns a good value then if pg_autovacuum is not running then start pg_autovacuum else error else error
Based on what I (think I) know, this covers the cases where:
1. There is not a valid instance of postgres running.
2. There is already a valid instance of pg_autovacuum running (which can still run as a daemon even in the event that postgres is stopped, IIRC).
3. It is safe to start pg_autovacuum because neither of the above cases holds.
Is this logic sufficiently sane?
In a subsequent iteration, I could even warn, I suppose, if the script discovered any vacuums (whether initiated by pg_autovacuum or no) already running.
-tfo
---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings