Shell command to stop NetAuthSysAgent on Mac OS Catalina

Posted by: tfabris

Shell command to stop NetAuthSysAgent on Mac OS Catalina - 09/06/2020 18:50

Uncle google isn't helping me well with this one, I'm wondering if anyone else knows this?

My Mac finder occasionally hangs when connecting to Samba shares, or hangs while connected to Samba shares, or it hangs when the share goes away and now I want to eject the share or disconnect or restart the computer or shut down the app that's using the share. Basically my problem is the same one as described here on StackExchange: https://apple.stackexchange.com/q/385068

Bouncing the Finder doesn't fix this one for me. I can fix it by rebooting the mac (if THAT doesn't hang too), but that's a hassle. I want to click an icon and make the problem go away without a reboot.

One of the responses to that question on StackExchange had my answer: https://apple.stackexchange.com/a/390352
If I run Activity Monitor and stop the process "NetAuthSysAgent" then bam, problem solved, everything instantly works again.

So I know how to do that by hand. What would the equivalent shell command be for gracefully stopping NetAuthSysAgent? I'm not sure if I can use a "kill" command for this, I'm thinking it'll be more along the lines of "launchctl unload" or something, but I'm not sure of the exact syntax.

Any ideas?
Posted by: andy

Re: Shell command to stop NetAuthSysAgent on Mac OS Catalina - 09/06/2020 21:21

kill or killlall should work fine
Posted by: mlord

Re: Shell command to stop NetAuthSysAgent on Mac OS Catalina - 09/06/2020 23:08

killall -TERM NetAuthSysAgent ; sleep 1 ; killall -KILL NetAuthSysAgent
Posted by: tfabris

Re: Shell command to stop NetAuthSysAgent on Mac OS Catalina - 10/06/2020 19:18

Thanks, guys! "sudo -S killall NetAuthSysAgent" is what I've settled on, and seems to work well.