How to cleanly quit/exit akregator remotely through ssh

Hello, despite a long research, i can’t find a way to close application (akregator , or any other app) cleanly, through ssh. I insist on the clean part : that is to say no “killall akregator” or such. I also underline that it is a command line that i would type in a ogged in ssh terminal.
I tried many qtdbus-qt5 but it lead to nowhere until now.
Thanks for your answers

Sorry, but I do not get the picture.

There is a system (let us call it alpha) where a user (let us call him bob) is logged in in the GUI, probably running a KDE session (because you mention akregator). And bob is using akregator in that session.

Then there is another system bravo where there is another user pete and he uses ssh to log in in system alpha. Or am I already wrong here in my assumptions?

In the above case, pete on alpha has no allowances to do anything with process akregator run by bob on alpha.

@Christophe_deR depending on the response to @hcvv if the ssh user and process user are the same , then pkill -<signal> -x <some-application> see man 7 signal

Thanks but, no : I don’t want to kill the akregator remotely since when i start it again on the remote machine , akregator will insult me because it was not stopped properly.

You are using abstractions that are too complex for me.
Here is the story :
1- i am on my laptop and akregator is running on my desktop.
2- i log through shh on the desktop from my laptop
3- i would like to stop cleanly akregator – without any ugly kill –
4- and then synchronize all the akregator files with unison as i used to do, and then restart akregator on my laptop with all the last rss feed
5- and i would like to it the other way

Step 3 is the problem

@Christophe_deR that’s why you need to use the correct signal to exit gracefully, pkill is just the name of the application, short for process kill and add your signal… You need to find out what that application will accept.

You are using abstractions that are too complex for me.
Here is the story :
1- i am on my laptop and akregator is running on my desktop.
2- i log through shh on the desktop from my laptop
3- i would like to stop cleanly akregator – without any ugly kill –
4- and then synchronize all the akregator files with unison as i used to do, and then restart akregator on my laptop with all the last rss feed
5- and i would like to it the other way

Step 3 is the problem

@Christophe_deR pkill is just a command, it’s the signal you use to exit the process. You need to test yourself and see which one works for that application.

i remember i already used pkill and i had the same insult from akregator as i got when i used “killall akregator”. Do you think i used the wrong signal ?

@Christophe_deR likely, I would try -19 or -20

Hopefully this helps explain;
Ref: https://faculty.cs.niu.edu/~hutchins/csci480/signals.htm

Thanks. I already tried “pkill” . And i just tried it again : " pkill -15 -x akregator " . And i get the same insult from akregator when i restart it saying that akregator was not shutdown properly and if i want to restore the session.
So, i confirm that i don’t want any kill and signal things because it does not avoid the proper termination of akregator.
What i need is the proper kde or qt or dbus or anything command line to close cleanly akregator.

Example of commandline using qtdbus to disconnect or log-out :

qdbus-qt5 org.kde.ksmserver /KSMServer logout -1 0 3

@Christophe_deR does akregator have a start with debug option, if so open a terminal and start it on your desktop and then shut it down to see what’s is using…

i have tried some " qdbus-qt5 org.kde.akregator " but don’t know what to add after this

Here is a list of examples of my failed tries
qdbus-qt5 org.kde.akregator /
qdbus-qt5 org.kde.akregator close
qdbus-qt5 org.kde.akregator / close
qdbus-qt5 org.kde.akregator /akregator close
qdbus-qt5 org.kde.akregator /Akregator close

thanks i’ll tried that

akregator --help-all
Utilisation : akregator [options] [url…]
Un agrégateur de flux pour KDE

Options :
-h, --help Displays help on commandline options.
–help-all Displays help including Qt specific
options.
-v, --version Afficher les informations de version.
–author Afficher les informations sur l’auteur.
–license Afficher les informations sur la
licence.
–desktopfile La base du nom de fichier de l’entrée
desktop pour cette application.
-a, --addfeed Ajouter un flux avec l’URL fournie
-g, --group L’ajout de flux se fait dans ce groupe
–hide-mainwindow Masquer la fenêtre principale au
démarrage
–qmljsdebugger Activates the QML/JS debugger with a
specified port. The value must be of
format port:1234[,block]. “block” makes
the application wait for a connection.
–platform <platformName[:options]> QPA plugin. See QGuiApplication
documentation for available options for
each plugin.
–platformpluginpath Path to the platform plugins.
–platformtheme Platform theme.
–plugin Additional plugins to load, can be
specified multiple times.
–qwindowgeometry Window geometry for the main window,
using the X11-syntax, like 100x100+50+50.
–qwindowicon Default window icon.
–qwindowtitle Title of the first window.
–reverse Sets the application’s layout direction
to Qt::RightToLeft (debugging helper).
–session Restores the application from an earlier
session.
–display Display name, overrides $DISPLAY.
–name Instance name according to ICCCM
4.1.2.5.
–nograb Disable mouse grabbing (useful in
debuggers).
–dograb Force mouse grabbing (even when running
in a debugger).
–visual ID of the X11 Visual to use.
–geometry Alias for --windowgeometry.
–icon Alias for --windowicon.
–title Alias for --windowtitle.

Arguments :
url Ajouter un flux avec l’URL fournie

akregator --qmljsdebugger 1234

No text-to-speech plug-ins were found.
QML Debugger: Ignoring “-qmljsdebugger=1234”. Debugging has not been enabled.

long list of http rss

when i quit :

kf.xmlgui: 0x55f1400cff18 deleted without having been removed from the factory first. This will leak standalone popupmenus and could lead to crashes.

I don’t know what to do, sorry

This is how I would stop akregator (just use qdbus-qt5 in your case)

qdbus6 org.kde.akregator /akregator/MainWindow_1/actions/file_quit org.qtproject.Qt.QAction.trigger

PS. Just a side note. I got tired of akregator so I installed RSS Guard. Much happier with it.

1 Like

Great answer “aggplanta” !
This is the winning command :
qdbus-qt5 org.kde.akregator /akregator/MainWindow_1/actions/file_quit org.qtproject.Qt.QAction.trigger

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.