2018-08-10 02:27:17 +02:00
|
|
|
#!/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
|
2018-08-10 02:27:17 +02:00
|
|
|
start_stop_daemon_args=""
|
|
|
|
|
2018-08-16 11:36:18 +02:00
|
|
|
depend() {
|
|
|
|
need ntpd
|
|
|
|
}
|
|
|
|
|
2018-08-10 02:27:17 +02:00
|
|
|
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
|
2018-08-10 02:27:17 +02:00
|
|
|
return 0
|
|
|
|
fi
|
2018-08-16 11:36:18 +02:00
|
|
|
einfo "Waiting..."
|
2018-08-10 02:27:17 +02:00
|
|
|
sleep 1
|
|
|
|
done
|
2018-08-16 11:36:18 +02:00
|
|
|
einfo "Timeout! postgresql wasn't ready in 60 seconds; aborting ${name} start ($description)"
|
2018-08-10 02:27:17 +02:00
|
|
|
return 1
|
|
|
|
}
|
2018-08-16 11:36:18 +02:00
|
|
|
# vim: set ft=sh bkc=yes:
|