[Debian-med-packaging] Bug#829380: Orthanc 1.2.0
Karsten Hilbert
Karsten.Hilbert at gmx.net
Thu Dec 29 13:32:01 UTC 2016
On Thu, Dec 29, 2016 at 11:02:25AM +0100, Sébastien Jodogne wrote:
> > may I ask for confirmation of the following behaviour:
> >
> > If Orthanc is manually started for a DB upgrade
> >
> > (say, on Debian:)
> > /usr/sbin/Orthanc --upgrade --trace /etc/orthanc/
> >
> > BUT the database is already at the required version THEN
> > Orthanc will not run the upgrade and fall back to starting
> > up as if --upgrade was not specified on the command line.
>
> No: If the "--upgrade" command-line option is provided, the Orthanc server
> will never start. If no upgrade is required, this is a void operation that
> returns immediately.
I would have thought so. However, why does this script:
#-------------------------------------------------
#!/bin/bash
# GPLv2 or later, Karsten Hilbert
set -x
LOGDIR=/var/log/orthanc
LOGFILE=${LOGDIR}/upgrade.log
ARGS="--upgrade --trace /etc/orthanc/"
ORTHANC_BINARY=`which Orthanc`
echo "Stopping Orthanc server..."
echo "#-----------" &> ${LOGFILE}
systemctl stop orthanc.service &>> ${LOGFILE}
RESULT=$?
echo "#-----------" &>> ${LOGFILE}
systemctl status orthanc.service &>> ${LOGFILE}
sleep 1s
if [ ${RESULT} -ne 0 ] ; then
echo "#-----------" &>> ${LOGFILE}
systemctl status orthanc.service &>> ${LOGFILE}
echo "Cannot stop Orthanc, please inspect the log: ${LOGFILE}"
read -p "Press <ENTER> to inspect the log" TMP
less ${LOGFILE}
exit ${RESULT}
fi
echo "Attempting database upgrade..."
echo "#-----------" &>> ${LOGFILE}
echo "Running <${ORTHANC_BINARY} ${ARGS}>" >> ${LOGFILE}
sudo -u orthanc ${ORTHANC_BINARY} ${ARGS} &>> ${LOGFILE}
RESULT=$?
if [ ${RESULT} -ne 0 ] ; then
cat ${ORTHANC_LOG} &>> ${LOGFILE}
echo "#-----------" &>> ${LOGFILE}
systemctl status orthanc.service &>> ${LOGFILE}
echo "Upgrade failed, please check the log: ${LOGFILE}"
read -p "Press <ENTER> to inspect the log" TMP
less ${LOGFILE}
exit ${RESULT}
fi
echo "Restarting Orthanc server..."
sleep 1s
echo "#-----------" &>> ${LOGFILE}
systemctl start orthanc.service &>> ${LOGFILE}
RESULT=$?
if [ ${RESULT} -ne 0 ] ; then
echo "#-----------" &>> ${LOGFILE}
systemctl status orthanc.service &>> ${LOGFILE}
echo "Cannot restart Orthanc, please check the log: ${LOGFILE}"
read -p "Press <ENTER> to inspect the log" TMP
less ${LOGFILE}
exit ${RESULT}
fi
echo ""
echo "Seems successful..."
echo "Log: ${LOGFILE}"
echo ""
systemctl status orthanc.service
#-------------------------------------------------
stop at "Attempting database upgrade" until I hit
CTRL-C and show this output:
#-------------------------------------------------
Skript gestartet auf Do 29 Dez 2016 13:28:46 CET
root at hermes:~/orthanc# ./orthanc-upgrade_db
+ LOGDIR=/var/log/orthanc
+ LOGFILE=/var/log/orthanc/upgrade.log
+ ARGS='--upgrade --trace /etc/orthanc/'
++ which Orthanc
+ ORTHANC_BINARY=/usr/sbin/Orthanc
+ echo 'Stopping Orthanc server...'
Stopping Orthanc server...
+ echo '#-----------'
+ systemctl stop orthanc.service
+ RESULT=0
+ echo '#-----------'
+ systemctl status orthanc.service
+ sleep 1s
+ '[' 0 -ne 0 ']'
+ echo 'Attempting database upgrade...'
Attempting database upgrade...
+ echo '#-----------'
+ echo 'Running </usr/sbin/Orthanc --upgrade --trace /etc/orthanc/>'
+ sudo -u orthanc /usr/sbin/Orthanc --upgrade --trace /etc/orthanc/
^C+ RESULT=0
+ '[' 0 -ne 0 ']'
+ echo 'Restarting Orthanc server...'
Restarting Orthanc server...
+ sleep 1s
+ echo '#-----------'
+ systemctl start orthanc.service
+ RESULT=0
+ '[' 0 -ne 0 ']'
+ echo ''
+ echo 'Seems successful...'
Seems successful...
+ echo 'Log: /var/log/orthanc/upgrade.log'
Log: /var/log/orthanc/upgrade.log
+ echo ''
+ systemctl status orthanc.service
[0;1;32m●[0m orthanc.service - LSB: Orthanc init script[m
Loaded: loaded (/etc/init.d/orthanc; generated; vendor preset: enabled)[m
Active: [0;1;32mactive (running)[0m since Thu 2016-12-29 13:29:26 CET; 19ms ago[m
Docs: man:systemd-sysv-generator(8)[m
Process: 29048 ExecStop=/etc/init.d/orthanc stop (code=exited, status=0/SUCCESS)[m
Process: 29146 ExecStart=/etc/init.d/orthanc start (code=exited, status=0/SUCCESS)[m
Tasks: 1 (limit: 4915)[m
CGroup: /system.slice/orthanc.service[m
└─29155 /usr/sbin/Orthanc --logdir=/var/log/orthanc /etc/orthanc/[m
[m
Dez 29 13:29:26 hermes systemd[1]: Starting LSB: Orthanc init script...[m
Dez 29 13:29:26 hermes systemd[1]: Started LSB: Orthanc init script.[m
[Kroot at hermes:~/orthanc# exit
exit
Skript beendet: Do 29 Dez 2016 13:29:36 CET
#-------------------------------------------------
producing the following log ?
#-------------------------------------------------
#-----------
#-----------
● orthanc.service - LSB: Orthanc init script
Loaded: loaded (/etc/init.d/orthanc; generated; vendor preset: enabled)
Active: inactive (dead) since Thu 2016-12-29 13:29:00 CET; 18ms ago
Docs: man:systemd-sysv-generator(8)
Process: 29048 ExecStop=/etc/init.d/orthanc stop (code=exited, status=0/SUCCESS)
Process: 28944 ExecStart=/etc/init.d/orthanc start (code=exited, status=0/SUCCESS)
Dez 29 13:27:55 hermes systemd[1]: Starting LSB: Orthanc init script...
Dez 29 13:27:55 hermes systemd[1]: Started LSB: Orthanc init script.
Dez 29 13:28:57 hermes systemd[1]: Stopping LSB: Orthanc init script...
Dez 29 13:29:00 hermes systemd[1]: Stopped LSB: Orthanc init script.
#-----------
Running </usr/sbin/Orthanc --upgrade --trace /etc/orthanc/>
W1229 13:29:01.755332 main.cpp:1238] Orthanc version: 1.2.0
W1229 13:29:01.755559 main.cpp:1095] Performance warning: Non-release build, runtime debug assertions are turned on
W1229 13:29:01.758150 OrthancInitialization.cpp:173] Scanning folder "/etc/orthanc/" for configuration files
W1229 13:29:01.758291 OrthancInitialization.cpp:125] Reading the configuration from: "/etc/orthanc/orthanc.json"
W1229 13:29:01.759062 OrthancInitialization.cpp:125] Reading the configuration from: "/etc/orthanc/webviewer.json"
W1229 13:29:01.759239 OrthancInitialization.cpp:125] Reading the configuration from: "/etc/orthanc/worklists.json"
W1229 13:29:01.759389 OrthancInitialization.cpp:125] Reading the configuration from: "/etc/orthanc/serve-folders.json"
W1229 13:29:01.759585 OrthancInitialization.cpp:125] Reading the configuration from: "/etc/orthanc/postgresql.json"
W1229 13:29:01.784588 FromDcmtkBridge.cpp:141] Loading the external DICOM dictionary "/usr/share/libdcmtk8/dicom.dic"
W1229 13:29:01.806442 FromDcmtkBridge.cpp:141] Loading the external DICOM dictionary "/usr/share/libdcmtk8/private.dic"
W1229 13:29:01.822995 OrthancInitialization.cpp:488] Registering JPEG Lossless codecs
W1229 13:29:01.823055 OrthancInitialization.cpp:493] Registering JPEG codecs
W1229 13:29:01.843845 main.cpp:632] Loading plugin(s) from: /usr/share/orthanc/plugins/
I1229 13:29:01.843939 PluginsManager.cpp:287] Scanning folder /usr/share/orthanc/plugins/ for plugins
I1229 13:29:01.844021 PluginsManager.cpp:310] Found a shared library: "/usr/share/orthanc/plugins/libOrthancPostgreSQLStorage.so"
W1229 13:29:01.845404 PluginsManager.cpp:268] Registering plugin 'postgresql-storage' (version 2.0)
T1229 13:29:01.845466 OrthancPlugins.cpp:2849] Calling service 7 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLStorage.so
T1229 13:29:01.845524 OrthancPlugins.cpp:2849] Calling service 13 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLStorage.so
W1229 13:29:01.845834 PluginsManager.cpp:167] Using PostgreSQL storage area
T1229 13:29:01.845860 OrthancPlugins.cpp:2849] Calling service 10 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLStorage.so
T1229 13:29:01.845887 OrthancPlugins.cpp:2849] Calling service 11 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLStorage.so
T1229 13:29:01.845915 OrthancPlugins.cpp:2849] Calling service 11 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLStorage.so
T1229 13:29:01.845942 OrthancPlugins.cpp:2849] Calling service 11 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLStorage.so
W1229 13:29:01.845976 PluginsManager.cpp:167] Locking of the PostgreSQL database is disabled
HINWEIS: Relation »storagearea« existiert bereits, wird übersprungen
T1229 13:29:01.875464 OrthancPlugins.cpp:2849] Calling service 1002 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLStorage.so
I1229 13:29:01.875534 OrthancPlugins.cpp:2693] Plugin has registered a custom storage area
I1229 13:29:01.875601 PluginsManager.cpp:310] Found a shared library: "/usr/share/orthanc/plugins/libServeFolders.so"
W1229 13:29:01.876142 PluginsManager.cpp:268] Registering plugin 'serve-folders' (version 1.2.0)
T1229 13:29:01.876207 OrthancPlugins.cpp:2849] Calling service 7 from plugin /usr/share/orthanc/plugins/libServeFolders.so
T1229 13:29:01.876240 OrthancPlugins.cpp:2849] Calling service 7 from plugin /usr/share/orthanc/plugins/libServeFolders.so
T1229 13:29:01.876299 OrthancPlugins.cpp:2849] Calling service 1004 from plugin /usr/share/orthanc/plugins/libServeFolders.so
I1229 13:29:01.876327 OrthancPlugins.cpp:1010] Plugin has registered a REST callback witout mutual exclusion on: /app/plugin-serve-folders.html
T1229 13:29:01.876504 OrthancPlugins.cpp:2849] Calling service 13 from plugin /usr/share/orthanc/plugins/libServeFolders.so
W1229 13:29:01.876814 PluginsManager.cpp:167] ServeFolders: Empty configuration file: No additional folder will be served!
I1229 13:29:01.876864 PluginsManager.cpp:310] Found a shared library: "/usr/share/orthanc/plugins/libOrthancWebViewer.so"
W1229 13:29:01.915318 PluginsManager.cpp:268] Registering plugin 'web-viewer' (version 2.2)
W1229 13:29:01.915399 PluginsManager.cpp:167] Initializing the Web viewer
T1229 13:29:01.915478 OrthancPlugins.cpp:2849] Calling service 7 from plugin /usr/share/orthanc/plugins/libOrthancWebViewer.so
T1229 13:29:01.915578 OrthancPlugins.cpp:2849] Calling service 13 from plugin /usr/share/orthanc/plugins/libOrthancWebViewer.so
W1229 13:29:01.915915 PluginsManager.cpp:167] Web viewer using 2 threads for the decoding of the DICOM images
W1229 13:29:01.915940 PluginsManager.cpp:167] Storing the cache of the Web viewer in folder: /tmp/OrthancWebViewerCache
I1229 13:29:01.917350 PluginsManager.cpp:171] No change in the versions, no need to clear the cache of the Web viewer
W1229 13:29:01.917565 PluginsManager.cpp:167] Web viewer using a cache of 100 MB
W1229 13:29:01.917605 PluginsManager.cpp:167] Using GDCM instead of the DICOM decoder that is built in Orthanc
T1229 13:29:01.917628 OrthancPlugins.cpp:2849] Calling service 1006 from plugin /usr/share/orthanc/plugins/libOrthancWebViewer.so
I1229 13:29:01.917671 OrthancPlugins.cpp:1108] Plugin has registered a callback to decode DICOM images (1 decoder(s) now active)
T1229 13:29:01.917711 OrthancPlugins.cpp:2849] Calling service 1000 from plugin /usr/share/orthanc/plugins/libOrthancWebViewer.so
I1229 13:29:01.917740 OrthancPlugins.cpp:1010] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/series/(.*)
T1229 13:29:01.917811 OrthancPlugins.cpp:2849] Calling service 1000 from plugin /usr/share/orthanc/plugins/libOrthancWebViewer.so
I1229 13:29:01.917844 OrthancPlugins.cpp:1010] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/is-stable-series/(.*)
T1229 13:29:01.917882 OrthancPlugins.cpp:2849] Calling service 1000 from plugin /usr/share/orthanc/plugins/libOrthancWebViewer.so
I1229 13:29:01.917912 OrthancPlugins.cpp:1010] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/instances/(.*)
T1229 13:29:01.917954 OrthancPlugins.cpp:2849] Calling service 1000 from plugin /usr/share/orthanc/plugins/libOrthancWebViewer.so
I1229 13:29:01.917984 OrthancPlugins.cpp:1010] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/libs/(.*)
T1229 13:29:01.918018 OrthancPlugins.cpp:2849] Calling service 1000 from plugin /usr/share/orthanc/plugins/libOrthancWebViewer.so
I1229 13:29:01.918048 OrthancPlugins.cpp:1010] Plugin has registered a REST callback with mutual exclusion on: /web-viewer/app/(.*)
T1229 13:29:01.918082 OrthancPlugins.cpp:2849] Calling service 1003 from plugin /usr/share/orthanc/plugins/libOrthancWebViewer.so
I1229 13:29:01.918115 OrthancPlugins.cpp:1035] Plugin has registered an OnChange callback
T1229 13:29:01.918137 OrthancPlugins.cpp:2849] Calling service 7 from plugin /usr/share/orthanc/plugins/libOrthancWebViewer.so
I1229 13:29:01.918201 PluginsManager.cpp:310] Found a shared library: "/usr/share/orthanc/plugins/libOrthancPostgreSQLIndex.so"
W1229 13:29:01.918928 PluginsManager.cpp:268] Registering plugin 'postgresql-index' (version 2.0)
T1229 13:29:01.918984 OrthancPlugins.cpp:2849] Calling service 7 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLIndex.so
T1229 13:29:01.919020 OrthancPlugins.cpp:2849] Calling service 13 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLIndex.so
W1229 13:29:01.919383 PluginsManager.cpp:167] Using PostgreSQL index
T1229 13:29:01.919408 OrthancPlugins.cpp:2849] Calling service 10 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLIndex.so
T1229 13:29:01.919504 OrthancPlugins.cpp:2849] Calling service 11 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLIndex.so
T1229 13:29:01.919536 OrthancPlugins.cpp:2849] Calling service 11 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLIndex.so
T1229 13:29:01.919565 OrthancPlugins.cpp:2849] Calling service 11 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLIndex.so
W1229 13:29:01.919601 PluginsManager.cpp:167] Locking of the PostgreSQL database is disabled
T1229 13:29:01.926855 OrthancPlugins.cpp:2849] Calling service 12 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLIndex.so
T1229 13:29:01.928808 OrthancPlugins.cpp:2849] Calling service 5002 from plugin /usr/share/orthanc/plugins/libOrthancPostgreSQLIndex.so
I1229 13:29:01.928877 OrthancPlugins.cpp:2766] Plugin has registered a custom database back-end
I1229 13:29:01.928958 PluginsManager.cpp:310] Found a shared library: "/usr/share/orthanc/plugins/libModalityWorklists.so"
W1229 13:29:01.929469 PluginsManager.cpp:268] Registering plugin 'worklists' (version 1.2.0)
W1229 13:29:01.929525 PluginsManager.cpp:167] Sample worklist plugin is initializing
T1229 13:29:01.929545 OrthancPlugins.cpp:2849] Calling service 7 from plugin /usr/share/orthanc/plugins/libModalityWorklists.so
T1229 13:29:01.929580 OrthancPlugins.cpp:2849] Calling service 13 from plugin /usr/share/orthanc/plugins/libModalityWorklists.so
W1229 13:29:01.929914 PluginsManager.cpp:167] The database of worklists will be read from folder: /var/lib/orthanc/worklists
T1229 13:29:01.929940 OrthancPlugins.cpp:2849] Calling service 1005 from plugin /usr/share/orthanc/plugins/libModalityWorklists.so
I1229 13:29:01.929970 OrthancPlugins.cpp:1054] Plugin has registered a callback to handle modality worklists
W1229 13:29:01.930023 main.cpp:1047] Using a custom database from plugins
W1229 13:29:01.930044 main.cpp:1058] Using a custom storage area from plugins
W1229 13:29:01.930379 HttpClient.cpp:685] HTTPS will use the CA certificates from this file: /etc/orthanc/
I1229 13:29:01.930427 HttpClient.cpp:151] Setting the default timeout for HTTP client connections: 10 seconds
I1229 13:29:01.930457 HttpClient.cpp:135] Setting the default proxy for HTTP client connections:
I1229 13:29:01.930479 DicomUserConnection.cpp:1209] Default timeout for DICOM connections if Orthanc acts as SCU (client): 10 seconds (0 = no timeout)
I1229 13:29:01.932059 ServerIndex.cpp:1887] Starting the monitor for stable resources (stable age = 60)
W1229 13:29:01.932758 LuaContext.cpp:103] Lua says: Lua toolbox installed
W1229 13:29:01.932878 ServerContext.cpp:181] Disk compression is disabled
I1229 13:29:01.932918 ServerContext.cpp:495] Storing MD5 for attachments: yes
W1229 13:29:01.932951 ServerIndex.cpp:1402] No limit on the number of stored patients
W1229 13:29:01.933044 ServerScheduler.cpp:134] The server scheduler has started
W1229 13:29:01.933425 ServerIndex.cpp:1419] No limit on the size of the storage area
I1229 13:29:01.934272 DicomServer.cpp:125] Setting timeout for DICOM connections if Orthanc acts as SCP (server): 30 seconds (0 = no timeout)
W1229 13:29:01.934736 main.cpp:822] DICOM server listening with AET ORTHANC on port: 4242
I1229 13:29:01.934813 MongooseServer.cpp:1001] HTTP keep alive is disabled
I1229 13:29:01.934832 DicomServer.cpp:63] DICOM server started
W1229 13:29:01.934882 MongooseServer.cpp:1027] HTTP compression is enabled
W1229 13:29:01.937574 main.cpp:757] HTTP server listening on port: 8042
W1229 13:29:01.937666 main.cpp:644] Orthanc has started
W1229 13:29:21.853433 main.cpp:702] Orthanc is stopping
W1229 13:29:21.964780 main.cpp:762] HTTP server has stopped
I1229 13:29:22.955748 DicomServer.cpp:84] DICOM server stopping
W1229 13:29:22.956919 main.cpp:838] DICOM server has stopped
I1229 13:29:23.935010 ServerIndex.cpp:1931] Closing the monitor thread for stable resources
W1229 13:29:23.935518 PluginsManager.cpp:218] Unregistering plugin 'postgresql-index' (version 2.0)
W1229 13:29:23.935608 PluginsManager.cpp:167] PostgreSQL index is finalizing
W1229 13:29:23.935792 PluginsManager.cpp:218] Unregistering plugin 'postgresql-storage' (version 2.0)
W1229 13:29:23.935870 PluginsManager.cpp:167] Storage plugin is finalizing
W1229 13:29:23.939691 PluginsManager.cpp:218] Unregistering plugin 'serve-folders' (version 1.2.0)
W1229 13:29:23.939836 PluginsManager.cpp:218] Unregistering plugin 'web-viewer' (version 2.2)
W1229 13:29:23.939882 PluginsManager.cpp:167] Finalizing the Web viewer
W1229 13:29:25.423567 PluginsManager.cpp:218] Unregistering plugin 'worklists' (version 1.2.0)
W1229 13:29:25.423671 PluginsManager.cpp:167] Sample worklist plugin is finalizing
W1229 13:29:25.424356 main.cpp:1297] Orthanc has stopped
#-----------
Anything I am doing wrong here ?
Thanks,
Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
More information about the Debian-med-packaging
mailing list