cog icon indicating copy to clipboard operation
cog copied to clipboard

cogctl communication to multiple instances does not work

Open ventosus opened this issue 2 years ago • 1 comments

With two cog instances (built with system DBUS):

cog --gapplication-app-id=com.example.ONE uri
cog --gapplication-app-id=com.example.TWO uri

There is no way to talk to both of them with cogctl by using the object path: (only the first one loaded can be talked to)

cogctl --system --object-path=/com/example/ONE reload -> OK

cogctl --system --object-path=/com/example/TWO reload
GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path ?/com/example/TWO?

There is no way to talk to both of them with cogctl by using the appid:

cogctl --system --appid=com.example.ONE reload
GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "com.example.ONE" does not exist

cogctl --system --appid=com.example.TWO reload
GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "com.example.TWO" does not exist

How should I talk to different cog instances? Am I doing something wrong?

ventosus avatar Aug 18 '22 16:08 ventosus

# cog --version
0.12.4 (WPE WebKit 2.36.3)

ventosus avatar Aug 18 '22 16:08 ventosus

Hello @ventosus - I also have been having trouble with cogctl and dbus. I wonder if theres something I am missing with my set up. I am running cog as root in an embedded environment. The system bus is at /run/dbus/... The environment variables for dbus are not getting set "automatically" in my case. Have you tried checking your environment variables (such as DBUS_SYSTEM_BUS_ADDRESS) for dbus?

Please find my post here: https://github.com/Igalia/cog/issues/532

chrisvollorenew avatar Jan 23 '23 15:01 chrisvollorenew

@chrisvollorenew dbus ist set up just fine on my side. my problem is addressing multiple instances of cog. addressing a single instance works just fine.

ventosus avatar Jan 23 '23 15:01 ventosus

The same identifiers passed to cog --gapplication-app-id= must be passed to cogctl --appid=:

# Start two instances with different application identifiers
cog --gapplication-app-id=com.example.Cog1 wpewebkit.org
cog --gapplication-app-id=com.example.Cog2 igalia.com
# Load different pages on each using cogctl
cogctl --appid=com.example.Cog1 open webkit.org
cogctl --appid=com.example.Cog2 open apple.com

You can see this in action in the screenshot below (note that -A is the same as --appid=):

Screenshot of a labwc compositor session, with two Cog instances and a terminal in the background running cogctl to open different pages on them

aperezdc avatar Feb 28 '23 13:02 aperezdc