mattrpav commented on code in PR #1884:
URL: https://github.com/apache/karaf/pull/1884#discussion_r1840867194
##########
shell/ssh/src/main/java/org/apache/karaf/shell/ssh/Activator.java:
##########
@@ -189,6 +194,20 @@ protected SshServer createSshServer(SessionFactory
sessionFactory) {
server.setKeyExchangeFactories(SshUtils.buildKexAlgorithms(kexAlgorithms));
server.setSignatureFactories(SshUtils.buildSigAlgorithms(sigAlgorithms));
server.setShellFactory(new ShellFactoryImpl(sessionFactory));
+ server.addSessionListener(new SessionListener() {
+ @Override
+ public void
sessionDisconnect(org.apache.sshd.common.session.Session session, int reason,
String msg, String language, boolean initiator) {
+ try {
+ Collection<ServiceReference<ChannelResourceCleaner>>
references = bundleContext.getServiceReferences(ChannelResourceCleaner.class,
null);
+ for (ServiceReference<ChannelResourceCleaner> reference :
references) {
+ ChannelResourceCleaner cleaner =
bundleContext.getService(reference);
+ cleaner.close();
Review Comment:
While we're at adding things to the Command/Action session.. this change is
needed due to JDK removal of Security Manager:
https://issues.apache.org/jira/browse/KARAF-7805
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]