diff --git a/docker/ttrss-openrc-apache b/docker/ttrss-openrc-apache index 581db74..49cf5f8 100755 --- a/docker/ttrss-openrc-apache +++ b/docker/ttrss-openrc-apache @@ -1,5 +1,10 @@ #!/sbin/runscript +depend() { + need ntpd +} + + start() { ebegin "Starting Apache (with wrapper)" start-stop-daemon --background --start --exec /bootstrap/start.sh \ @@ -16,3 +21,4 @@ stop() { --pidfile /var/run/apache2/httpd.pid eend $? } +# vim: set ft=sh bkc=yes: diff --git a/docker/ttrss-openrc-ntpd b/docker/ttrss-openrc-ntpd new file mode 100755 index 0000000..8fe8641 --- /dev/null +++ b/docker/ttrss-openrc-ntpd @@ -0,0 +1,12 @@ +#!/sbin/openrc-run + +name="ntpd" +description="update clock" +command="/usr/sbin/ntpd" +command_user="root" +pidfile="/run/$name.pid" +command_args="-s -p $pidfile" +start_stop_daemon_args="" + + +# vim: set ft=sh bkc=yes: diff --git a/docker/ttrss-openrc-ttrssupdate b/docker/ttrss-openrc-ttrssupdate index f4db867..7d3fd1d 100755 --- a/docker/ttrss-openrc-ttrssupdate +++ b/docker/ttrss-openrc-ttrssupdate @@ -6,15 +6,22 @@ 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; then + if env PGPASSWORD=password-dev psql -h db -U ttrss -w ttrss -c "" -q; then return 0 fi - einfo "Waiting... ( $? )" + 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: