Re: ubus running key status
On 2024-02-29 12:56, Ravi Paluri (QUIC) wrote: Thanks, Paul for the reply. Can you help us with a sample usage of "ubus subscribe" OR "ubus listen" OR "ubus monitor", which helps us to learn, "running" flag change to false from true. I know not whether such is even possible. Start here: https://git.openwrt.org/project/ubus.git We are polling the status of "running" flag as below. ubus call service list '{"name":"test*.init","verbose":"True"}' | grep -i \"running\" Is * even supposed to work? this shows the unetd instance: ubus call service list '{"name":"unetd"}' this does not: ubus call service list '{"name":"unet*"}' ubus call service list '{"name":"unetd"}' | jsonfilter -q -e "@['unetd'].instances[*].running" returns simply: true This is working when script execution takes some time. For some scripts that take very less time (for e.g, a single instruction such as "uci set .."), we are not able to detect the transition of "running" flag to false from true as the flag changes it's value quickly. How about using the return code of the script? Thanks, Ravi -Original Message- From: openwrt-devel On Behalf Of Paul D Sent: Friday, February 23, 2024 7:35 PM To: openwrt-devel@lists.openwrt.org Subject: Re: ubus running key status WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros. On 2024-02-23 13:43, Ravi Paluri (QUIC) wrote: Can you let us know, is there a way to get a notification when the "running" key value moves to "false" from "true"? OR is there any ubus API to which we can register a callback, which will then be invoked when the execution is complete? Not certain about callbacks - but there is "ubus monitor" "ubus subscribe" "ubus listen" and "ubus wait_for" They're blocking calls, at least. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
RE: ubus running key status
Thanks, Paul for the reply. Can you help us with a sample usage of "ubus subscribe" OR "ubus listen" OR "ubus monitor", which helps us to learn, "running" flag change to false from true. We are polling the status of "running" flag as below. ubus call service list '{"name":"test*.init","verbose":"True"}' | grep -i \"running\" This is working when script execution takes some time. For some scripts that take very less time (for e.g, a single instruction such as "uci set .."), we are not able to detect the transition of "running" flag to false from true as the flag changes it's value quickly. Thanks, Ravi -Original Message----- From: openwrt-devel On Behalf Of Paul D Sent: Friday, February 23, 2024 7:35 PM To: openwrt-devel@lists.openwrt.org Subject: Re: ubus running key status WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros. On 2024-02-23 13:43, Ravi Paluri (QUIC) wrote: > Can you let us know, is there a way to get a notification when the "running" > key value moves to "false" from "true"? > OR is there any ubus API to which we can register a callback, which will then > be invoked when the execution is complete? Not certain about callbacks - but there is "ubus monitor" "ubus subscribe" "ubus listen" and "ubus wait_for" They're blocking calls, at least. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
RE: ubus running key status
The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software.--- Begin Message --- Thanks, Paul for the reply. Can you help us with a sample usage of "ubus subscribe" OR "ubus listen" OR "ubus monitor", which helps us to learn, "running" flag change to false from true. We are polling the status of "running" flag as below. ubus call service list '{"name":"test*.init","verbose":"True"}' | grep -i \"running\" This is working when script execution takes some time. For some scripts that take very less time (for e.g, a single instruction such as "uci set .."), we are not able to detect the transition of "running" flag to false from true as the flag changes it's value quickly. Thanks, Ravi -Original Message- From: openwrt-devel On Behalf Of Paul D Sent: Friday, February 23, 2024 7:35 PM To: openwrt-devel@lists.openwrt.org Subject: Re: ubus running key status WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros. On 2024-02-23 13:43, Ravi Paluri (QUIC) wrote: > Can you let us know, is there a way to get a notification when the "running" > key value moves to "false" from "true"? > OR is there any ubus API to which we can register a callback, which will then > be invoked when the execution is complete? Not certain about callbacks - but there is "ubus monitor" "ubus subscribe" "ubus listen" and "ubus wait_for" They're blocking calls, at least. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel --- End Message --- ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: ubus running key status
On 2024-02-23 13:43, Ravi Paluri (QUIC) wrote: Can you let us know, is there a way to get a notification when the "running" key value moves to "false" from "true"? OR is there any ubus API to which we can register a callback, which will then be invoked when the execution is complete? Not certain about callbacks - but there is "ubus monitor" "ubus subscribe" "ubus listen" and "ubus wait_for" They're blocking calls, at least. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel