Feedati/docker/ttrss-openrc-ttrssupdate

28 lines
638 B
Text
Raw Normal View History

#!/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"
2018-08-16 11:36:18 +02:00
command_background=true
start_stop_daemon_args=""
2018-08-16 11:36:18 +02:00
depend() {
need ntpd
}
start_pre() {
for _ in $(seq 1 60); do
2018-08-16 11:36:18 +02:00
if env PGPASSWORD=password-dev psql -h db -U ttrss -w ttrss -c "" -q; then
return 0
fi
2018-08-16 11:36:18 +02:00
einfo "Waiting..."
sleep 1
done
2018-08-16 11:36:18 +02:00
einfo "Timeout! postgresql wasn't ready in 60 seconds; aborting ${name} start ($description)"
return 1
}
2018-08-16 11:36:18 +02:00
# vim: set ft=sh bkc=yes: