Re: how to kill child process?

2020-08-25 Thread vapnik spaknik via General Guile related discussions
On Monday, August 24, 2020, 07:47:42 PM GMT+1, Sebastian Miele wrote: >When I put > >  (let ((pid  (primitive-fork)) >        (host        THE-HOST) >        (control  "~/.ssh/%C")) >    (if (eq? 0 pid) >        (execlp "ssh" "ssh" >                "-F" "none" >                "-S" control >   

Re: how to kill child process?

2020-08-24 Thread Sebastian Miele
vapnik spaknik writes: > > Even without the '-f' flag I still get the same problem in guile. If > I print the pid of the child process I can see that it is different > from the pid of the ssh process. When I put (let ((pid (primitive-fork)) (host THE-HOST) (control

Re: how to kill child process?

2020-08-24 Thread vapnik spaknik via General Guile related discussions
>On Monday, August 24, 2020, 03:27:57 PM GMT+1, Sebastian Miele > wrote: > >Look at output of the following: > >  pkill ssh >  ssh -S '~/.ssh/socket/%C' -N -M -f & >  echo $! >  pgrep -a ssh > >Then look at the output of: > > pkill ssh >  ssh -S '~/.ssh/socket/%C' -N -M & >  echo $! >  pgrep

Re: how to kill child process?

2020-08-24 Thread Sebastian Miele
Me: > Look at output of the following: > > pkill ssh > ssh -S '~/.ssh/socket/%C' -N -M -f & > echo $! > pgrep -a ssh > > Then look at the output of: > > pkill ssh > ssh -S '~/.ssh/socket/%C' -N -M & > echo $! > pgrep -a ssh > For the tests I temporarily renamed my '~/.ssh/config'

Re: how to kill child process?

2020-08-24 Thread Sebastian Miele
vapnik spaknik writes: > Oops, I forgot to include the "-M" flag in the previous post. That > ensures the ssh connection is a master connection, and I get the same > problem. Look at output of the following: pkill ssh ssh -S '~/.ssh/socket/%C' -N -M -f & echo $! pgrep -a ssh Then look

Re: how to kill child process?

2020-08-24 Thread vapnik spaknik via General Guile related discussions
>On Monday, August 24, 2020, 01:05:31 PM GMT+1, Sebastian Miele > wrote: >vapnik spaknik writes: >> (execlp "ssh" "ssh" "-S" "~/.ssh/%C" "-N" "-f" "remotehost") >> >> However, this doesn't work >The problem probably is the following: The above invocation of 'ssh' >with '-S' is the invocati

Re: how to kill child process?

2020-08-24 Thread Sebastian Miele
vapnik spaknik writes: > (execlp "ssh" "ssh" "-S" "~/.ssh/%C" "-N" "-f" "remotehost") > > However, this doesn't work The problem probably is the following: The above invocation of 'ssh' with '-S' is the invocation of a slave. It creates a master (with a new PID). After that it immediately exi

Re: how to kill child process?

2020-08-24 Thread vapnik spaknik via General Guile related discussions
>This does not answer your exact question, but such behavior can be >acheived very automatically by putting something like the following into >~/.ssh/config: > >  ControlMaster auto >  ControlPath ~/.ssh/socket/%C >  ControlPersist 5 > >This automatically creates master processes.  And the respe

Re: how to kill child process?

2020-08-23 Thread Sebastian Miele
Me: > vapnik spaknik writes: > > >> ssh -S ~/.ssh/%C -N -f remotehost & > >> rsync -au -e "ssh -S ~/.ssh/%C remotehost" remotehost:file1 > backupdir/file1 > >> rsync -au -e "ssh -S ~/.ssh/%C remotehost" remotehost:file2 > backupdir/file2 > > > > and finally, find the pid and kill the ssh session:

Re: how to kill child process?

2020-08-23 Thread Sebastian Miele
vapnik spaknik writes: >> ssh -S ~/.ssh/%C -N -f remotehost & >> rsync -au -e "ssh -S ~/.ssh/%C remotehost" remotehost:file1 backupdir/file1 >> rsync -au -e "ssh -S ~/.ssh/%C remotehost" remotehost:file2 backupdir/file2 > > and finally, find the pid and kill the ssh session: > >> ps -e|grep ssh >

how to kill child process?

2020-08-23 Thread vapnik spaknik
Hi, I'm writing a backup script in guile, and want to run rsync several times over the same ssh connection. >From the shell command line I can start an ssh session with a control master >socket, and then tell ssh to reuse that socket with each invocation of rsync: > ssh -S ~/.ssh/%C -N -f rem