[systemd-devel] [systemd-level]: how to set property to read only in systemd?
www
ouyangxuan10 at 163.com
Wed Apr 22 10:17:51 UTC 2020
Thank you very much for your help。
thanks,
Byron
At 2020-04-21 20:53:02, "Lennart Poettering" <lennart at poettering.net> wrote:
>On Di, 21.04.20 19:54, www (ouyangxuan10 at 163.com) wrote:
>
>> hi Lennart,
>>
>>
>> I mean the DBUS property.
>>
>> root at demoboard:/# busctl set-property org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus Features as 1 x
>>
>> Cannot set read-only property -- the default
>>
>>
>>
>>
>> root at demoboard:/# busctl set-property com.sugon.sensors.DISCRETE /com/sugon/sensors/HDD/HDD4_Status xyz.openbmc_project.Sensor.DiscreteAll FanDeviceInserted b true -- new add
>>
>> root at demoboard:/#
>>
>>
>>
>> I want the property on Dbus is read only. Just can modify by the
>> special method and cannot modify the property directly. How can I
>> change it like this?
>
>Is "com.sugon.sensors.DISCRETE" a service you implemented yourself?
>With the sd-bus API?
>
>In sd-bus you define a writable property in a vtable with the
>SD_BUS_WRITABLE_PROPERTY() macro, and a read-only one with
>SD_BUS_PROPERTY().
>
>But not sure I grok your question properly.
>
>Lennart
>
>--
>Lennart Poettering, Berlin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20200422/b9f5036a/attachment-0001.htm>
More information about the systemd-devel
mailing list