Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> AFAIK there's no way to have the kernel notify you of when a different process starts listening on a port.

Would the ExecCondition be appropriate here, minimally, with a script that runs `lsof -nP -iTCP:${yourport} -sTCP:LISTEN`?



I'm talking: once your process has started, how do you wait for a process you depend on?

Obviously if systemd opens the port for you it's easy enough (in this case, even across machines), but otherwise you have to do a sleep loop. And I'm not sure how dependency restarts work in this case.

ExecCondition must moves the spin to systemd, and has more overhead than doing in your own process. There's no point in gratuitously restarting after all.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: