Hands-on task
A pidfile for the preview service
The server runs two Python services that look identical: the site preview and the documentation. The deploy script expects the PID of the preview service in /run/preview.pid, and the preview is the one listening on port 8002. The port number isn't in the processes' command lines: it comes from a config. Find the PID and write just the number to /run/preview.pid.
- pidfile
- ss -p
- finding a process by port
- grep -o
- pid