#!/sbin/openrc-run name="ttrssupdate" description="continously update tt-rss feeds" command="/usr/bin/php7" command_args="/app/public/tt-rss/update.php --daemon" command_user="apache" pidfile="/run/$name.pid" command_background=true start_stop_daemon_args="" depend() { need ntpd } start_pre() { for _ in $(seq 1 60); do if env PGPASSWORD=password-dev psql -h db -U ttrss -w ttrss -c "" -q; then return 0 fi einfo "Waiting..." sleep 1 done einfo "Timeout! postgresql wasn't ready in 60 seconds; aborting ${name} start ($description)" return 1 } # vim: set ft=sh bkc=yes: