But I am getting this error, every time this command is executed.
The error
dbus[3533]: arguments to dbus_message_new_method_call() were incorrect, assertion "iface == NULL || _dbus_check_is_valid_interface (iface)" failed in file ../../../dbus/dbus-message.c line 1367.
This is normally a bug in some application using the D-Bus library.
D-Bus not built with -rdynamic so unable to print a backtrace
Any help would be really appreciated
Thanks in advance
Well, i only have used this command on Ubuntu Core devices yet (i.e. from kiosk snaps running as daemons), so i don’t know if on a classic install something like policykit gets in the way and it might also only work when the app is run as root (i.e. as a service or via sudo) … perhaps @jamesh has an idea …
That doesn’t look like something that polkit could cause: it looks like a client-side error rather than an error from logind. The error in question says that the interface name passed to dbus-send (which would be everything before the final dot in the first positional argument) is not a valid D-Bus interface name.
What you’ve pasted looks correct though, so it might help if you could provide a bit more context to how you’re calling this.
Hi @jamesh. I have created a shell script named restart, converted it into an executable, and then calling the executable when certain conditions are met.
does the script work when run outside of confinement?
can you run the script directly within confinement? This could be done by running snap run --shell myapp, which will drop you to a shell running within the same sandbox your app would. From there you could try executing $SNAP/restart.
TBH this looks more like your script does not end up being executable inside the snap … also make sure to use snap run --shell <snapname>.<app> when wanting to test inside confinement
Hi @ogra. Sorry for the late reply. If it does end up as an executable, then I think it should at least work if I use the command
bash restart
Well, I tried the command above and I got the same error as mentioned above.
dbus[3533]: arguments to dbus_message_new_method_call() were incorrect, assertion "iface == NULL || _dbus_check_is_valid_interface (iface)" failed in file ../../../dbus/dbus-message.c line 1367.
This is normally a bug in some application using the D-Bus library.
D-Bus not built with -rdynamic so unable to print a backtrace
I will test some more ways to call the shell script and try out other approaches. I will get back to you If I find something. Thanks for looking into my issue.