Rereading .service files when added/removed and updated

Mikael Hallendal
Mon, 01 Mar 2004 16:50:57 +0100


I'm currently working on making the bus reread .service files when
they've been updated, new ones added or a service file has been removed.
Before starting to write any actual code I'd just wanted to run the
proposed way over the list.

The check will be carried out when a service is activated. If the
service exists in the activation->entries hash table we first check if
the file still exists on the filesystem, if it has been removed the
entry is removed and a DBUS_ERROR_ACTIVATE_SERVICE_NOT_FOUND is replied
to the activating client.

If the file exists we check the mtime and compare it to the one in the
activation entry to see if it has been updated. If updated the file is
reread before the activation continues.

If the service is not found in the entries hash table we check the mtime
of the service directories to see if any of the directories has changed.
If noone has the service still isn't available and a not found error is
replied. Otherwise we go through the changed directories and adds any
new files, after that we check if the service is available. 

It would also be possible to reread any updated .service files during
that stage but I'm not sure if that's wanted.

What do you think?

  Mikael Hallendal
Mikael Hallendal     
Imendio HB           
Phone: +46 (0)709 718 918