forked from blallo/Feedati
ttrss: start ntpd first
This commit is contained in:
parent
896c6a49d8
commit
0c6feb350a
3 changed files with 27 additions and 2 deletions
|
@ -1,5 +1,10 @@
|
||||||
#!/sbin/runscript
|
#!/sbin/runscript
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need ntpd
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
ebegin "Starting Apache (with wrapper)"
|
ebegin "Starting Apache (with wrapper)"
|
||||||
start-stop-daemon --background --start --exec /bootstrap/start.sh \
|
start-stop-daemon --background --start --exec /bootstrap/start.sh \
|
||||||
|
@ -16,3 +21,4 @@ stop() {
|
||||||
--pidfile /var/run/apache2/httpd.pid
|
--pidfile /var/run/apache2/httpd.pid
|
||||||
eend $?
|
eend $?
|
||||||
}
|
}
|
||||||
|
# vim: set ft=sh bkc=yes:
|
||||||
|
|
12
docker/ttrss-openrc-ntpd
Executable file
12
docker/ttrss-openrc-ntpd
Executable file
|
@ -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:
|
|
@ -6,15 +6,22 @@ command="/usr/bin/php7"
|
||||||
command_args="/app/public/tt-rss/update.php --daemon"
|
command_args="/app/public/tt-rss/update.php --daemon"
|
||||||
command_user="apache"
|
command_user="apache"
|
||||||
pidfile="/run/$name.pid"
|
pidfile="/run/$name.pid"
|
||||||
|
command_background=true
|
||||||
start_stop_daemon_args=""
|
start_stop_daemon_args=""
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need ntpd
|
||||||
|
}
|
||||||
|
|
||||||
start_pre() {
|
start_pre() {
|
||||||
for _ in $(seq 1 60); do
|
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
|
return 0
|
||||||
fi
|
fi
|
||||||
einfo "Waiting... ( $? )"
|
einfo "Waiting..."
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
einfo "Timeout! postgresql wasn't ready in 60 seconds; aborting ${name} start ($description)"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
# vim: set ft=sh bkc=yes:
|
||||||
|
|
Reference in a new issue