Re: [systemd-devel] Dbus service

2018-09-24 Thread Lennart Poettering
On Di, 18.09.18 15:07, deepan muthusamy (deepan.m2...@gmail.com) wrote:

> What is the difference between dbus service and bus-activatable service?

That's really a question to ask the D-Bus mailing list, not the
systemd one.

That said: a dbus service just means a service offering IPC interfaces
via dbus. A bus-activatable service is a special kind of dbus service:
it means the IPC interfaces are also offered while the service isn't
started yet, and a client talking to such an IPC interface will then
implicitly trigger starting of that service by doing so. "activatable"
is just a fancy word for saying "can be started by", i.e. "triggred
on-demand by".

By building systems with bus-activatable services you build more
robust, simpler and more efficient systems, as services don't have to
run all the time, and clients don't have to know when precisely a
service is started, but can talk to the service anyway, and rely that
the dbus system will implicitly start any service that is not running
yet, fully transparently.

Examples for such bus-activable services are "policykit" for example,
or systemd's own "hostnamed", both of which normally don't run, but
when a client wants to talk to them are implicitly started.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Dbus service

2018-09-18 Thread deepan muthusamy
What is the difference between dbus service and bus-activatable service?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] DBus service name encoding

2013-03-05 Thread Lennart Poettering
On Mon, 04.03.13 19:00, Simon McVittie (simon.mcvit...@collabora.co.uk) wrote:

 
 On 04/03/13 14:31, Lennart Poettering wrote:
  So here's how to do this, it's very simple: every char outside of the
  A-Za-z0-9 range is escaped as _XY where XY is the numeric code of the
  char, as 2 char lower-case hex value. Note that _ itself is also
  escaped, to _5f.
 
 This sounds a lot like Telepathy's tp_escape_as_identifier(). Before
 freezing this as ABI, you might want to consider a couple of the more
 subtle points from that function:
 
 * we also escape any leading digit in the same way, so that a name
   starting with a digit is escaped as a valid bus name component
   (123.service - _3123_2eservice, because the D-Bus specification
   says Only elements that are part of a unique connection name may
   begin with a digit)
 
 * for completeness, we also escape  into _ (because a zero-length
   string is not a valid D-Bus name component)
 
 This results in its output being a valid D-Bus bus-name element,
 interface-name element, member, and object-path element, and also a
 valid C identifier.

Thanks for the suggestions! I have now updated systemd to follow the
same logic in these corner cases. I also added test cases so that this
should  be pretty much set in stone now.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] DBus service name encoding

2013-03-04 Thread Lennart Poettering
On Sun, 03.03.13 19:06, David Strauss (da...@davidstrauss.net) wrote:

 I can't find any documentation on how service names get encoded for
 DBus. It looks pretty close to URL encoding with underscores instead
 of percent signs.
 
 If I can get a definitive answer, I'll update the wiki. If I can't, I
 can, of course, dive into the source.

This hasn't been documented since it so far wasn't part of the official
ABI. So far you were supposed to invoke GetUnit() with an unescaped unit
name, and it would return you the (escaped) bus path for it. Now, a
while back systemctl was updated to simply do the escaping on the client
side, to get rid of this roundtrip. systemctl of course is shipped with
systemd, so it's not a problem for it to make use of this undocumented
behaviour. That said, we could (and probably should) just open this up
for external users too.

So here's how to do this, it's very simple: every char outside of the
A-Za-z0-9 range is escaped as _XY where XY is the numeric code of the
char, as 2 char lower-case hex value. Note that _ itself is also
escaped, to _5f.

This is implemented in bus_path_escape() in src/shared/util.c. 

If you want to make use of it, please update the wiki dbus docs for the
PID 1 interfaces, and document this there to make this official ABI, and
refer to the sources (and maybe this mail). Please also add a comment
line to the sources referring back to the wiki, so that people who
change bus_path_escape() are aware that this is something that is part
of the documented ABI.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] DBus service name encoding

2013-03-04 Thread Simon McVittie
On 04/03/13 14:31, Lennart Poettering wrote:
 So here's how to do this, it's very simple: every char outside of the
 A-Za-z0-9 range is escaped as _XY where XY is the numeric code of the
 char, as 2 char lower-case hex value. Note that _ itself is also
 escaped, to _5f.

This sounds a lot like Telepathy's tp_escape_as_identifier(). Before
freezing this as ABI, you might want to consider a couple of the more
subtle points from that function:

* we also escape any leading digit in the same way, so that a name
  starting with a digit is escaped as a valid bus name component
  (123.service - _3123_2eservice, because the D-Bus specification
  says Only elements that are part of a unique connection name may
  begin with a digit)

* for completeness, we also escape  into _ (because a zero-length
  string is not a valid D-Bus name component)

This results in its output being a valid D-Bus bus-name element,
interface-name element, member, and object-path element, and also a
valid C identifier.

S
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] DBus service name encoding

2013-03-04 Thread David Strauss
On Mon, Mar 4, 2013 at 11:00 AM, Simon McVittie
simon.mcvit...@collabora.co.uk wrote:
 Before freezing this as ABI, you might want to consider a couple of the more
 subtle points from that function

Considering that those two suggestions cover cases not yet handled by
systemd's still-informal specification, I see no reason to object.

-- 
David Strauss
   | da...@davidstrauss.net
   | +1 512 577 5827 [mobile]
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] DBus service name encoding

2013-03-03 Thread David Strauss
I can't find any documentation on how service names get encoded for
DBus. It looks pretty close to URL encoding with underscores instead
of percent signs.

If I can get a definitive answer, I'll update the wiki. If I can't, I
can, of course, dive into the source.

-- 
David Strauss
   | da...@davidstrauss.net
   | +1 512 577 5827 [mobile]
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel