Project

General

Profile

Bug #30870

Feature #30777: re-attach serial console device

Ensure shell is killed on connection close

Added by Marcelo Araujo over 1 year ago. Updated about 1 year ago.

Status:
Done
Priority:
No priority
Assignee:
William Grzybowski
Category:
Middleware
Target version:
Severity:
Med High
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

Tested with: FreeNAS-11-MASTER-201803260406
Machine: FREENAS-MINI-2.0

I was debugging the issue #30777 and I discover that "Display System Processes", "Jail shell" and the "Shell" has a similar problem.
The problems seems that webshell doesn't finish the process when we are not using the shell anymore, even if I close the web browser, the processes are still running on FreeNAS.

Here is an example how to simulate the issue:
1) Connect on FreeNAS using the new UI.
2) Click in "Display System Processes"
3) click in any other menu option.
4) Do steps 2 and 3 several times.
5) Connect via ssh into FreeNAS.
6) Run: ps ax | grep top | wc -l

root@freenas:~ # ps ax | grep top | wc -l
14

Also the same issue happens with 'iocage console' as an example:
1) Create a jail and start it.
2) Connect via Shell
3) Click in any other menu option.
4) Go back to Jail and connect via Shell again.
5) Do several times steps 2 to 4.
6) ps ax | grep iocage

root@freenas:~ # ps ax | grep iocage
73275 2 S+ 0:00.00 grep iocage
72954 27 Is 0:04.27 /usr/local/bin/python3.6 /usr/local/bin/iocage console Test
73023 28 Is 0:04.23 /usr/local/bin/python3.6 /usr/local/bin/iocage console Test
73265 29 Ss 0:04.23 /usr/local/bin/python3.6 /usr/local/bin/iocage console Test

Note: For Jail shell example above, if I close the web browser tab, it finishes all the running processes.

Here is the Jail shell changes on middlewared side: https://github.com/freenas/freenas/pull/945

Best,


Related issues

Related to FreeNAS - Bug #35275: Close websocket connection when navigating away from Jail Shell in new UIDone
Blocks FreeNAS - Feature #30225: VNC button for VMs should be Connect button with multiple connection protocolsDone2018-03-19

History

#1 Updated by Dru Lavigne over 1 year ago

  • Target version set to 11.2-RC2

#2 Updated by Dru Lavigne over 1 year ago

  • Blocks Feature #30225: VNC button for VMs should be Connect button with multiple connection protocols added

#3 Updated by Vaibhav Chauhan over 1 year ago

  • Category changed from GUI (new) to Middleware
  • Assignee changed from Erin Clark to William Grzybowski

I think william fixed this issue with this PR on the backend side. https://github.com/freenas/freenas/pull/1044, I had fixed the front end issue as a part of https://github.com/freenas/webui/pull/558

#4 Updated by William Grzybowski over 1 year ago

  • Status changed from Not Started to In Progress
  • Target version changed from 11.2-RC2 to 11.2-BETA1
  • Severity set to Med High

#5 Updated by William Grzybowski over 1 year ago

  • Status changed from In Progress to Done
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#6 Updated by Dru Lavigne over 1 year ago

  • Status changed from Done to Closed
  • Target version changed from 11.2-BETA1 to N/A
  • Reason for Closing set to Not Applicable

#7 Updated by William Grzybowski over 1 year ago

  • Status changed from Closed to Done
  • Reason for Closing deleted (Not Applicable)

#8 Updated by Dru Lavigne over 1 year ago

  • Subject changed from Webshell with process hanging forever. to Ensure shell is killed on connection close
  • Target version changed from N/A to 11.2-BETA1

#9 Updated by Dru Lavigne over 1 year ago

  • Has duplicate Feature #23799: [VM] Add a way to connect to console port via web. added

#10 Updated by Dru Lavigne over 1 year ago

  • Has duplicate deleted (Feature #23799: [VM] Add a way to connect to console port via web.)

#11 Updated by Dru Lavigne about 1 year ago

  • Status changed from Done to Ready for Testing

#12 Updated by Rishabh Chauhan about 1 year ago

  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No

after following the steps and consulting will william

1. After sshing into freenas:

When FreeNAS shell is open in the webui

freenas# ps ax | grep top | wc -l
2

When FreNAS shell is closed(moving to a new tab)

freenas# ps ax | grep top | wc -l
1

2. After creating iocage shell and navigating in and out,ssh and check

freenas# ps ax | grep iocage

19018 2 S+ 0:00.00 grep iocage
18834 26 Is 0:02.07 /usr/local/bin/python3.6 /usr/local/bin/iocage consol
18883 29 Is 0:02.07 /usr/local/bin/python3.6 /usr/local/bin/iocage consol
18955 33 Is 0:02.07 /usr/local/bin/python3.6 /usr/local/bin/iocage consol

bold should not be present although when i close the tab and open again the ouptput is this
freenas# ps ax | grep iocage
19114 2 S+ 0:00.00 grep iocage

after discussing with william, we concluded that the issue is with the new webui shell, not with the middleware hence filing a new ticket with the same for new GUI #30870

#13 Updated by Dru Lavigne about 1 year ago

  • Related to Bug #35275: Close websocket connection when navigating away from Jail Shell in new UI added

#14 Updated by Dru Lavigne about 1 year ago

  • Related to deleted (Bug #35275: Close websocket connection when navigating away from Jail Shell in new UI)

#15 Updated by Dru Lavigne about 1 year ago

  • Related to Bug #35275: Close websocket connection when navigating away from Jail Shell in new UI added

#16 Updated by Dru Lavigne about 1 year ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF