Registered Member
|
I want to start an ssh screen session in Konsole from a script
(/etc/rc.local) run on the machine I want to connect to. e.g.:- Box A boots and runs rc.local that then uses an ssh command to start a konsole session, for which there is no previously defined profile, on Box B that connects to Box A. This works fine when I'm calling a previously defined profile on Box B. e.g.:- ;the script on box A (/etc/rc.local):-
;the konsole profile on box B e.g.:- (/home/scott/.kde/share/apps/konsole/dev.profile):-
I've tried various CLI options using both the "-p Command=" and "-c <command>" without success. Box A has the SSH key copied to it, and is listed in known_hosts on Box B. e.g.:- /etc/rc.local (Box A):-
I've also tried with only the "-p Command=" with and without the --new-tab, as well as different orders of Konsole parameters. Everything works fine if I don't try the command i.e. just use:-
I really don't want to resort to the :- Box A Test for existing profile on Box B (using ssh)
Debian 7 with backports enabled. Qt: 4.8.2 KDE Development Platform: 4.8.4 (4.8.4) Konsole: 2.8.4 Kind regards |
Administrator
|
Other than the command to execute, and icon, is there anything else special about the previously non-existent profile?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
I don't understand your question. I'm not sure how I could clarify things without repeating myself. The profile doesn't exist - so I'm not sure what is special about it. If there was a profile I'd have no problems. i.e. for boxes I regularly access remotely they have something like the following example in /etc/rc.local which works fine, because it's calling an existing profile (see last command) e.g.:-
|
Administrator
|
If you are aware of the fields in the Konsole profile which differ from system to system, you could have the rc.local script generate one and scp it to the system where Konsole will be executed prior to running Konsole.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
They don't differ from system to system. There are no other systems (on which KDE is running). Box A could be any of hundreds of remote headless servers - for which reason I don't want to create local konsole profiles (there can be no remote konsole profiles). Box B is always my workstation - which only has one version of Konsole on it (the version noted in the OP). I apologise if that confused you.
I could , but, as I noted in the OP (you must of missed that):-
I don't want to have to do that (create hundreds of different konsole profiles). Some of these servers are only ever accessed once or twice (cloud instances). It should be possible to call konsole and invoke the same -p profile parameters and -e commands that are available locally don't you think? Perhaps I should just submit a bug report upstream as it's likely not a Debian problem, at the very least the documentation should be updated to reflect the failing. |
Administrator
|
I fail to see the problem it seems. To clarify - Konsole is always being executed on the same system, and the *same* profile, which is *exactly* the same (for all settings, including title, command, etc) is always executed irregardless of the system which is going to execute Konsole?
If so, then you should be able to simply hardcode the profile name as is, and use the -e option to temporarily override the command as needed. Be aware that the -e option likely won't invoke a shell, so you'll need to ask for it to be executed if you need to run multiple commands, one after the other.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Yes.
Yes.
No.
No (again).
"Reusing" an existing profile means altering that profile if it's already in use - which defeats the purpose. i.e. if I have an existing profile (e.g. dev - see OP) that uses a particular icon (e.g. "=network-server") and hardcodes the RemoteTabTitleFormat (e.g. "=dev : %u") and uses a Command (e.g. "=ssh -t dev screen -dR") I can "reuse" it, but every change to the existing profile parameters results in a change to any konsole sessions using that profile. Example - this works, but it modifies any exiting Konsole instance using that profile (dev):-
Yes, I'm aware of that (see OP). In those circumstances I use the -p Command="CommandToRunInShell" - but, part of the point of this thread, the -p Command=ssh $Something" doesn't seem to work when called via ssh from another box. |
Administrator
|
I see, i've checked the Konsole code and why I can't see why what you've done above doesn't work, you should be able to substitute "-p Command=" for "-e". Please note that Command= is also affected by the same shell issues.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]