[SailfishDevel] monitor systemd unit from qml

Michael Fuchs michfu at gmx.at
Wed Jan 27 16:28:24 UTC 2016


It's a user unit which gets started by e.g. "systemctl --user start 
syncthing".

Am 27.01.2016 um 17:22 schrieb Andrey Kozhevnikov:
> your own service?
>
> ------ Исходное сообщение ------
> От: "Michael Fuchs" <michfu at gmx.at>
> Кому: "Sailfish OS Developers" <devel at lists.sailfishos.org>
> Отправлено: 27.01.2016 22:23:33
> Тема: Re: [SailfishDevel] monitor systemd unit from qml
>
>> I would just like to know about the state of the service. Is it
>> running or not?
>> My app has a start/stop button for the service, which already works.
>> But it would be nice to know about the state of the service, when the
>> app is starting up.
>>
>> Am 27.01.2016 um 17:19 schrieb r0kk3rz:
>>> For what purpose? systemd takes care of monitoring services for you.
>>>
>>> You can however define various actions which you can hook into on
>>> service start/stop/fail .etc
>>> http://www.freedesktop.org/software/systemd/man/systemd.service.html
>>>
>>>
>>> On Wed, Jan 27, 2016 at 4:03 PM, Michael Fuchs <michfu at gmx.at
>>> <mailto:michfu at gmx.at>> wrote:
>>>
>>>     Hi,
>>>
>>>     I would need some help, please.
>>>
>>>     I'm trying to monitor a systemd service unit via dbus from qml.
>>>
>>>     There is a signal "PropertiesChanged" defined but it doesn't get
>>>     emitted, when I start or stop the service.
>>>
>>>     Code:
>>>     https://gist.github.com/fuchsmich/354af082fbc4577a4bf5
>>>
>>>     The GetAll method works and it returns the needed property
>>>     org.freedesktop.systemd1.Unit.ActiveState.
>>>     So how can I listen to the change of ActiveState?
>>>
>>>     thanks,
>>>     Michael.
>>>     _______________________________________________
>>>     SailfishOS.org Devel mailing list
>>>     To unsubscribe, please send a mail to
>>>     devel-unsubscribe at lists.sailfishos.org
>>>     <mailto:devel-unsubscribe at lists.sailfishos.org>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> SailfishOS.org Devel mailing list
>>> To unsubscribe, please send a mail to
>>> devel-unsubscribe at lists.sailfishos.org
>>>
>> _______________________________________________
>> SailfishOS.org Devel mailing list
>> To unsubscribe, please send a mail to
>> devel-unsubscribe at lists.sailfishos.org
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org


More information about the Devel mailing list