On Di, 2011-03-15 at 11:19 +0000, Frederik Elwert wrote:
> Hi!
>
> Am Dienstag, den 15.03.2011, 11:26 +0100 schrieb Patrick Ohly:
> > Second problem: syncevo-dbus-server might be running while packages are
> > updated, which leads to the situation that it uses an old libsynthesis
> > in memory.
> >
> > I'm not entirely sure how to solve that second problem. I could try
> > dynamic loading of libsynthesis, but that only covers the libsynthesis
> > dependency and not the update of SyncEvolution itself, nor of any of the
> > other shared libraries in use by the process. If anyone has suggestions
> > for how user-space restarts are meant to be handled by distros, then
> > please let me know.
>
> I’m surely no expert on this matter, but I know that Ubuntu has somewhat
> a mechanism for this, since firefox upgrades notify the user to restart
> firefox.
>
> The postinst script for firefox contains this snippet:
>
> if [ -d $UPDATENOTIFIERDIR ] ; then
> # pgrep matches application names from /proc/<pid>/status which is
> # truncated according to sys/procfs.h definition. Problem is it's
> # platform dependent. Either 15 or 16 chars.
> if [ `/usr/bin/pgrep -x -c firefox` -ne 0 ] ||
> [ `/usr/bin/pgrep -x -c $APPNAME` -ne 0 ] ; then
> cp -f $LIBDIR/$APPNAME-restart-required.update-notifier \
> $UPDATENOTIFIERDIR/$APPNAME-restart-required
> else
> rm -f $UPDATENOTIFIERDIR/$APPNAME-restart-required
> fi
> fi
>
> /usr/lib/firefox-3.6.15/firefox-restart-required.update-notifier
> contains:
I don't seem to have that on Debian.
> The downside of this is that it requires manual user intervention, but I
> don’t know if there is an easy way for end-users to restart
> snyncevo-dbus-server.
No, which makes this notification-based method unsuitable for the
daemon.
The problem is that the package update must interact with one or more
user sessions. Sending a D-Bus message to the syncevo-dbus-server on the
session bus is non-trivial. The system bus could be used, but only for
broadcast signals.
My current thinking is to solve the problem in syncevo-dbus-server
locally, without support by the package manager:
* at startup, determine a list of all shared libraries loaded into
memory (/proc/self/maps)
* set up change notifications for these files
* when triggered *and* idle, restart the daemon
If the package update happens while a sync starts, then there is a risk
that it'll fail, but I expect that time range to be very small.
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
_______________________________________________
SyncEvolution mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution