nico wrote: > Ah that's a shame the process is still a bit brittle. > > Are you certain there was no SP process running prior to kicking off the > socats and ssh? In my case, if that was so, I also experienced the kinds > of wrinkles you described. The issue is with the "fork" option on socat > - if it's running and there's application traffic on that UDP port being > generated by SP, it can fork off many child processes to handle it. So > if there is UDP traffic there may be a race condition with the "killall > socat" killing off the parent process but leaving one or more children, > or vice versa. For more insight killall also provides a "-v" option > which describes what processes it's killing more verbosely. If SP is not > running there should be no UDP traffic on 3483 and the killall socat > should work as intended. > > By using the shell "cmd1 && cmd2" operator, this should absolutely > ensure that cmd2 is not invoked before cmd1 terminates, and moreover, > terminates successfully. Alternatively you can use "cmd1; cmd2" for > serial execution of 2 commands on a single line - in that case cmd2 > always runs after cmd1 irrespective of the exit status of cmd1. So I > don't think the issue is the killall not completing before with socat is > launched. > > I have not tested putting shell operators like "&&" or "&" into the > RemoteCommand line in ~/.ssh/config. But it would not surprise me if > these don't work as intended. It would all come down to the exact way > ssh forks off the remote shell and passes the command + arguments to it. > I would recommended that if you need to use "&&" or "&" operators, it's > best to put everything into a single shell script file and just launch > that from the RemoteCommand directive (which is what I think you ended > up doing). Make sure you specify the full path to your shell script on > the remote machine to avoid issues with the PATH variable. > > It would not hurt to put a killall socat into the remote command script. > If you are doing it on one line, make sure you use "&&" or ";" (not > "&") to separate the killall and the socat. Of course, if you place > these commands on separate lines, this would also ensure the commands > are executed sequentiually rather than in parallel. In my case however, > I found that in 100% of the cases when I killed the ssh session with > Ctrl-C, it always killed off the remote socat(s) as well. So I found I > didn't need that remote "killall socat". But again, depending on the OS > and versions of SSH used etc., it wouldn't surprise me if in some cases > the remote socat is left running in the background and should be killed > off explicitly. > > Sometimes it's better to go with simpler solutions to these things > rather than trying to come up with clever 1-liners :) Indeed - thanks. However, it took me 30 seconds to work out what SP meant - I'm not good with abbreviations I've never seen before ;)
LMS 7.9.2 on VortexBox Midi box, Xubuntu 18.04, FLACs 16->24 bit, 44.1->192kbps. 2 Touchs & EDO. LMS plugin UPnP/DLNA Bridge to MF M1 CLiC (A308CR amp & ESLs) & Marantz CR603 UPnP renderers. Also Minimserver & Upplay to same & to upmpdcli/mpd PC renderers. Squeezelite to Meridian USB Explorer DAC to PC speakers/headphones. Wireless Xubuntu 18.04 laptop firefox/upplay or Android 'phone with Squeeze-Commander/BubbleUPnP controls LMS/Minimserver. ------------------------------------------------------------------------ PasTim's Profile: http://forums.slimdevices.com/member.php?userid=41642 View this thread: http://forums.slimdevices.com/showthread.php?t=108734 _______________________________________________ Squeezecenter mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/squeezecenter
