cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1959
Views
0
Helpful
4
Replies

Stop NSO running process

Does anyone know how to stop an NSO running process?

Examples:
-Perform sync-from on 100 devices (ssh keys not yet fetched, so each starts to fail sync-from), I ctrl+C, but sync-from is still running

-A action to scp a device image to a device (notice it is incorrect, want to kill process then send correct image)

 

We have had to try and use ps and kill processes that way because ctrl+C inside of NSO brings you back to the terminal but does not stop the process. I understand it may not want to stop the process because of atomicity, however is there a clean and/or dirty way to kill processes inside of NSO? Such as the action that pushes an image we would be fine killing, a partial image would get pushed, and we wouldn't care too much. For killing something like sync-from would be fine because it isn't touching device configuration.

It gets questionable if you try to kill a commit or something, but we would like to be able to make use of process tracking or killing for the given examples.

 

We've looked at 'show jobs', however something like a sync-from or a action do not show up under jobs, jobs are more for something like to monitor.

Any thoughts?

4 Replies 4

joepak
Cisco Employee
Cisco Employee
Hi,

Ctrl-c performs the following - Abort a command/Clear Line

I would assume upon performing a sync-from or scp-to/from action, doing ctrl-c should abort the action.

Can you verify/confirm that the sync-from/scp action is still performed after supposedly aborting the command via ctrl-c?

Here is an scp-to example:

Here's a way to see the issue for yourself:

  1. Find a big file.  Or make your own: 
    dd if=/dev/urandom of=/tmp/bigfile bs=4096 count=1000000
  2. Use NSO to SCP it to a device.
    devices device csr1 scp-to local-file /tmp/bigfile remote-file bigfile
  3. In another window, log in to the device directly (e.g., with SSH) and check the size of the file
    dir bigfile
    If you repeat this command, you can watch the file grow.
  4. Back in NSO, use ctrl-c to abort the scp process.  You'll see a message like "Aborted: by user"
    Even though it says aborted, it is still now running in the background.  You can confirm this by going back to your other window and seeing that the file size is continuing to grow in size.

 

 

We encountered the same thing when initially onboarding devices, where we did not fetch the ssh host keys and ran connect, of course every device was failing. We ctrl+C out of the connect, however it still attempted every device.

I accidentally forgot about this discussion... I would say open a TAC case to further investigate. Simply provide your observations/evidence and let's see if TAC can assist you further.

 

 

Thank you!

Thanks Joey, we have a TAC case open, I thought I would check if anyone on Dev Hub had other ideas or work arounds.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: