Re: Feature Request: PID writeout on background

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



On 10/28/20 5:36 AM, Damien Miller wrote:
> On Tue, 27 Oct 2020, chris wrote:
>
>> Hi all.
>>
>> I have a simple feature request for the devs and maintainers; when
>> forking into the background using the -f optarg one would normally have
>> to consult the process table of whatever OS they're running to find the
>> process. Would you consider adding another optarg to write the PID out
>> to stdout or a pidfile? This would be rather helpful in several
>> usecases.
>
> You can retrieve this if you configure a control socket:
>
> $ ssh -S /tmp/sock -nNf host
> $ ssh -S /tmp/sock -O check host
> Master running (pid=3509649)
> $ ssh -S /tmp/sock -O exit host
> Exit request sent.

There might also be a 'ControlMaster' setting hidden in ssh_config(5) in
that example.  It seems to be needed to create the designated socket:

$ ssh -S /tmp/sock -Nf server.example.com;  ls -lh /tmp/sock
ls: cannot access '/tmp/sock': No such file or directory

$ ssh -S /tmp/sock -MNf server.example.com; ls -lh /tmp/sock
srw------- 1 lars lars 0 Oct 28 07:29 /tmp/sock

I notice that with -f the $! variable stays blank.

/Lars
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev



[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux