[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: orthanc-postgresql



On Mon, Mar 02, 2015 at 12:36:55PM +0100, Sébastien Jodogne wrote:

> > I have just created and committed a Debian package for the official
> > plugin that replaces the default SQLite database of Orthanc, by a
> > PostgreSQL back-end [1]. This package turns Orthanc into a scalable
> > vendor neutral archive for DICOM images.
> 
> I have just thought about a possible problem with this
> plugin. Indeed, using it makes the startup of the Orthanc
> service dependent on the startup of the PostgreSQL service:

Which to ensure has happened is the task of systemd and its
predecessors. (Note that, ATM, systemd is the default init
system and Orthanc should provide init information tailored
to that, but that's a nitpick as far as your questions go).

> Orthanc will crash if it started after PostgreSQL.

(you probably mean that the other way round ?)

Orthanc should gracefully fail if it cannot connect to
PostgreSQL, rather than crash (but I cannot imagine you don't
already do it that way).

> It would therefore be logical to modify the
> "/etc/init.d/orthanc" file [1] by applying the patch attached
> to this mail. However, this dependency cannot be added inside
> the main "orthanc" package, as PostgreSQL is not a dependency
> of the default version of Orthanc (that internally uses
> SQLite).

Hm, hm, a conditional startup dependancy.

This

	http://www.freedesktop.org/software/systemd/man/systemd.unit.html

sayeth

	Note that while systemd offers a flexible dependency
	system between units it is recommended to use this
	functionality only sparingly and instead rely on
	techniques such as bus-based or socket-based activation
	which make dependencies implicit, resulting in a both
	simpler and more flexible system.

Does this point in the right direction ?

> Could someone tell me how this case could be handled?
> Should the "orthanc-postgresql" package patch
> "/etc/init.d/orthanc" from "postinst" and un-apply the patch
> from "postrm"?

Again, Debian strictly recommends against modifying files of
other packages. However, this might be solved by a (really
small) package orthanc-sqlite which CONFLICTS: with
orthanc-postgresql, both of which providing orthanc-backend
and both providing /etc/init.d/orthanc.init as appropriate.

Orthanc itself would then depend on orthanc-backend (which is
satisfied by both -sqlite and -postgresql).

:-)

Karsten
-- 
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346


Reply to: