-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No asynchronous response when service is stopped #416
Comments
I have same issue :(
log when I start/stop service many times: 2024/03/19 01:39:34 Service s-kek-1.service ActiveState changed to: active sometimes I see "deactivating" but always see "no status" when service stopped BTW I see all logs in dbus monitor:
|
@ndeubert solution found!
Output:
|
Ah cool. thank you for following up |
I noticed when using this code:
I do not get any events from the
asyncstatus
channel when the service is stopped in a terminal withsudo systemctl stop service1
like I do when I start a service withid, err := o.conn.StartUnitContext(o.ctx, svcName, "replace", o.async)
orsudo systemctl start service1
Even if I stop the service programmatically with
id, usererr := o.conn.StopUnitContext(o.ctx, o.cfg.PlatCfg.ServiceName1, "replace", o.async)
I only see "done" on the
async
channel.If I want to find out about these events do I need to use the dbus interface directly? Do I need to poll myself or use
o.asyncstatus, o.asyncerr = o.conn.SubscribeUnits(1 * time.Second)
and check if it goes away?. If I kill the process manually then I do get a "failed" event on theasyncstatus
channel. I didn't see any mention of this being expected behavior in the documentation, but it seems odd not to be supported given the rest of the behavior. Thanks.The text was updated successfully, but these errors were encountered: