curl / Mailing Lists / curl-users / Single Mail

curl-users

Re: Finding PID of a curl process

From: Jon Seymour <jon.seymour_at_gmail.com>
Date: Mon, 29 Apr 2019 16:59:08 +1000

The low tech solution is to wrap curl with a shell script that has the
behaviour you want.

If you are concerned about the overhead of having a waiting shell
script for each curl invocation, then you might consider writing your
own curl dispatcher daemon that can launch and track running curl
processes using the facilities Linux/unix already provide for this
purpose.

Having applications like curl, facilitate adhoc process control
mechanisms of the kinds you want because your application is unable to
make good use of the perfectly good process control mechanisms
POSIX-like systems already possess seems counter productive.

On Mon, Apr 29, 2019 at 4:46 PM Jon Harris <jharris_at_symetrix.co> wrote:
>
> "Shouldn't this be something that you handle from your C program? If you're in control of the fork call, you know the PID.
> dR"
>
> I was oversimplifying the problem for the sake of this discussion. I have cases where curl is launched from an external script and/or needs to be monitored by a process other than the one that started it. It would be convenient to easily find the pid in those cases, the same way you can for many daemons out there.
>
> -----------------------------------------------------------
> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
> Etiquette: https://curl.haxx.se/mail/etiquette.html

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-04-29