Skip to content

Commit 72dfd61

Browse files
authored
Merge pull request #1717 from diedertimmers/KARAF-7682
[KARAF-7682] Changed handling of the TCP connection to send the stop command
2 parents a357131 + 50d92c1 commit 72dfd61

File tree

1 file changed

+3
-1
lines changed
  • main/src/main/java/org/apache/karaf/main

1 file changed

+3
-1
lines changed

main/src/main/java/org/apache/karaf/main/Stop.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ public static void main(String[] args) throws Exception {
5656
if (config.shutdownPort > 0) {
5757
try (Socket s = new Socket(config.shutdownHost, config.shutdownPort)) {
5858
s.getOutputStream().write(config.shutdownCommand.getBytes());
59-
System.exit(0);
59+
s.getOutputStream().write('\n');
60+
s.getOutputStream().flush();
6061
} catch (ConnectException connectException) {
6162
System.err.println("Can't connect to the container. The container is not running.");
6263
System.exit(1);
6364
}
65+
System.exit(0);
6466
} else {
6567
// using the pid file
6668
int pid = getPidFromPidFile(config.pidFile);

0 commit comments

Comments
 (0)