Skip to content

Commit

Permalink
startstop: last final episode
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwutz committed Mar 28, 2024
1 parent 84bfe57 commit a1b2f58
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 128 deletions.
9 changes: 9 additions & 0 deletions README.todo
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ bug:
☐ https://github.com/paperless-ngx/paperless-ngx/discussions/3090
Calling OCRmyPDF with args: {'input_file': PosixPath('/scratch/local/plprj/2024-02-19/paperless-ngx34bhqotl/c913a207C78B05A-B130-45F8-9EC4-281AD914ABFA}.PDF'), 'output_file': PosixPath('/scratch/local/plprj/2024-02-19/paperless-0ee3414u/archive.pdf'), 'use_threads': True, 'jobs': 32, 'language': 'deu+eng', 'output_type': 'pdfa', 'progress_bar': False, 'color_conversion_strategy': 'RGB', 'force_ocr': True, 'clean_final': True, 'deskew': True, 'rotate_pages': True, 'rotate_pages_threshold': 12.0, 'sidecar': PosixPath('/scratch/local/plprj/2024-02-19/paperless-0ee3414u/sidecar.txt')}

☐ /node_modules/.bin/ng build --configuration production
Locale data for 'ar-AR' cannot be found. Using locale data for 'ar'.
WARNING [src/locale/messages.ar_AR.xlf]: File target locale ('ar') does not match configured locale ('ar-AR')
Locale data for 'af-ZA' cannot be found. Using locale data for 'af'.
WARNING [src/locale/messages.af_ZA.xlf]: File target locale ('af') does not match configured locale ('af-ZA')
Locale data for 'bg-BG' cannot be found. Using locale data for 'bg'.
WARNING [src/locale/messages.bg_BG.xlf]: File target locale ('bg') does not match configured locale ('bg-BG')


upgrade:
ssl-certs in conf umziehen

Expand Down
3 changes: 0 additions & 3 deletions buildall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ ln -fs "${logfile}" "${LOGS}/build.log"
./startstop.build.sh
[ -d "${BUILD_sqlite}" ] || ./sqlite.build.sh
[ -d "${BUILD_redis}" ] || ./redis.build.sh
./redis.startstop.build.sh
[ -d "${BUILD_python}" ] || ./Python.build.sh
[ -d "${BUILD_node}" ] || ./node.build.sh
[ -d "${BUILD_ffmpeg}" ] || ./ffmpeg.build.sh
Expand All @@ -75,9 +74,7 @@ ln -fs "${logfile}" "${LOGS}/build.log"
[ -d "${BUILD_libfontttf}" ] || ./liberation-fonts-ttf.build.sh
[ -d "${BUILD_nginx}" ] || ./nginx.build.sh
./nginx.conf.build.sh
./nginx.startstop.build.sh
[ -d "$PROJECT/${BUILD_paperless}" ] || ./paperless-ngx.build.sh
./paperless-gunicorn.startstop.build.sh


} 2>&1 | tee "$logfile" 2>&1
108 changes: 0 additions & 108 deletions startstop-paperless.build.sh

This file was deleted.

35 changes: 18 additions & 17 deletions startstop.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,18 @@ cmd="\${1:-help}"
srv="\${2:-all}"
if [[ \${srv} = 'all' ]]; then
for srv in redis nginx ; do # gunicorn consumer scheduler worker; do
for srv in redis nginx gunicorn consumer scheduler worker; do
echo "### ./startstop.sh \${cmd} \${srv}"
./startstop.sh \${cmd} \${srv}
./startstop.sh \${cmd} \${srv} || echo "RET: $?"
done
exit
fi
echo "## ${PROJECT}"
PIDFILE=${DEVSHM}/srv-\${srv}.pid
SIDFILE=${DEVSHM}/srv-\${srv}.sid
PGIDFILE=${DEVSHM}/srv-\${srv}.pgid
function rm_pidfiles() {
rm -fv "\${PIDFILE}" "\${SIDFILE}" "\${PGIDFILE}"
rm -fv "\${PIDFILE}" "\${PGIDFILE}"
}
#### nginx ####
Expand All @@ -57,6 +54,7 @@ srv_nginx_stop() {
#### redis ####
srv_redis_start() {
# redis is special: it would start under any condition
local _opts=(
--port 0
--unixsocket "${DEVSHM}/redis.sock"
Expand Down Expand Up @@ -134,7 +132,7 @@ srv_generic_status() {
read -a pid < "\${PIDFILE}"
ps -f --pid \${pid} --ppid \${pid}
else
echo "# no pgid or pid file found: \${PGIDFILE} \${PIDFILE} "
echo "# no pgid or pid file found: \${PGIDFILE} \${PIDFILE}"
fi
fi
}
Expand All @@ -145,13 +143,15 @@ srv_generic_stop() {
read -a pgid < "\${PGIDFILE}"
echo "killing process group \${pgid}"
kill -- -\${pgid}
echo "waiting for process group \${pgid} to die"
echo "waiting for process group \${pgid} to die"
pwait --pgroup \${pgid}
else
if [[ -s "\${PIDFILE}" ]]; then
local pid
read -a pid < "\${PIDFILE}"
ps -f --pid \${pid} --ppid \${pid}
kill -- \${pid}
echo "waiting for process \${pid} to die"
tail -f --pid=\${pid} /dev/null
else
echo "# no pid file found: \${PGIDFILE}"
fi
Expand All @@ -165,31 +165,32 @@ srv_generic_restart() {
#### main() ####
set -x
if [[ \$(type -t srv_\${srv}_\${cmd}) = 'function' ]]; then
case "\${cmd}" in
start)
mkdir -p "${DEVSHM}" "${LOGDIR}" "${TMPDIR}"
[[ -s "\${PIDFILE}" ]] && echo "# \${PIDFILE} found, refuse start of \${srv}" && exit 0
[[ -s "\${SIDFILE}" ]] && echo "# \${SIDFILE} found, refuse start of \${srv}" && exit 0
[[ -s "\${PGIDFILE}" ]] && echo "# \${PGIDFILE} found, refuse start of \${srv}" && exit 0
exec 99>"\${PIDFILE}" || exit 1
flock 99 || exit 1
set -m
coproc {
set -m
srv_\${srv}_\${cmd};
srv_\${srv}_\${cmd};
} > ${LOGDIR}/srv-\${srv}.log 2>&1
echo "\${COPROC_PID}" > "\${PIDFILE}"
echo "\${COPROC_PID}" >> "\${PIDFILE}"
ps opgid= "\${COPROC_PID}" > "\${PGIDFILE}"
ps osid= "\${COPROC_PID}" > "\${SIDFILE}"
exit
;;
*)
echo "########## default fallback to srv_\${srv}_\${cmd} ###############"
srv_\${srv}_\${cmd}
exit
;;
esac
else
echo "srv_\${srv}_\${cmd}() not declared"
# echo "srv_\${srv}_\${cmd}() not declared"
if [[ \$(type -t srv_generic_\${cmd}) = 'function' ]]; then
srv_generic_\${cmd}
exit
Expand Down

0 comments on commit a1b2f58

Please sign in to comment.