Why `nohup postgres 2>&1 > postgres.log &` instead of `pg_ctl start`? You could also use `pg_ctl -w start` to wait for proper server startup instead of `sleep 2`
I'll look into that, though, as it sounds like the right thing vs the sleep hack.
(before the file redirection instead of after)