[systemd-devel] [RFC 1/6] proxy-discoveryd: Basic core added

Tom Gundersen teg at jklm.no
Mon Apr 13 03:54:36 PDT 2015


On Mon, Apr 13, 2015 at 12:05 PM, Tomasz Bursztyka
<tomasz.bursztyka at linux.intel.com> wrote:
>>> +int manager_new(Manager **ret);
>>> +Manager *manager_free(Manager *m);
>>> +
>>> +DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free);
>>> +#define _cleanup_manager_free_ _cleanup_(manager_freep)
>>
>> We generally try to avoid this define in internal code, and just use
>> _cleanup_(manager_freep) inline.
>
>
> Ok, I followed networkd but indeed other parts don't do that (machined for
> instance).

Do as I say, not as I do :P I didn't get the memo yet when I wrote the
initial networkd parts, I should fix this up to avoid confusion in the
future.

>>> diff --git a/units/.gitignore b/units/.gitignore
>>> index ad469c1..63ae1af 100644
>>> --- a/units/.gitignore
>>> +++ b/units/.gitignore
>>> @@ -51,6 +51,7 @@
>>>   /systemd-networkd.service
>>>   /systemd-nspawn at .service
>>>   /systemd-poweroff.service
>>> +/systemd-proxy-discoveryd.service
>>>   /systemd-quotacheck.service
>>>   /systemd-random-seed.service
>>>   /systemd-reboot.service
>>> diff --git a/units/systemd-proxy-discoveryd.service.in
>>> b/units/systemd-proxy-discoveryd.service.in
>>> new file mode 100644
>>> index 0000000..7ac02e0
>>> --- /dev/null
>>> +++ b/units/systemd-proxy-discoveryd.service.in
>>> @@ -0,0 +1,18 @@
>>> +# This file is part of systemd.
>>> +#
>>> +# systemd is free software; you can redistribute it and/or modify it
>>> +# under the terms of the GNU Lesser General Public License as published
>>> by
>>> +# the Free Software Foundation; either version 2.1 of the License, or
>>> +# (at your option) any later version.
>>> +
>>> +[Unit]
>>> +Description=Proxy service
>>> +DefaultDependencies=no
>>> +Requires=dbus.socket
>>> +After=dbus.socket
>>> +Before=remote-fs.target
>>> +
>>> +[Service]
>>> +Restart=on-failure
>>> +ExecStart=@rootlibexecdir@/systemd-proxy-discoveryd
>>> +StandardOutput=null
>>
>> Why this special handling of stdout? Is it the JS engine? Probably
>> should have a comment as it is a bit odd.
>
>
> I copy-pasted the .service file we had for pacrunner, this needs to be
> tailored for proxy-discoveryd.
>
> The stdout directing to /dev/null is to avoid the JS engine to print
> anything.
> Though for duktape specifically, we can hook the debug/printing/warning/...
> functions, so we could
> redirect messages to the logs.

That's what I thought. Would be nice to hook this up properly
internally I think. Either to just redirect to /dev/null there, or to
log correctly.

-t


More information about the systemd-devel mailing list