Welcome to the new Linux Foundation Forum!

Issues in lab 25.2

The answer to question 2 doesn't make sense to me.

  1. Find out what current PIDs are being issued

  2. Type:
    $ cat &
    [1] 29222
    $ kill -9 29222

The solution only shows you the PID for cat (granted, it's an example of the current number range available which seems the point) and it doesn't need to be killed as it is stopped soon after execution (on CentOS).
Wouldn't the better answer either be 'jobs -p' or 'ps [-ef]'?

Again, in question 4, cat does not need to be killed.. :D

Also there's a minor typo in the second paragraph of the PDF: 'However, when the PID reaches the value shown [in is missing] /proc/sys/kernel/pid_max'

Comments

  • coopcoop Posts: 229

    Typo fixed for next version

    cat &

    shows the actual new PID being issued, which is what the question is. Jobs -p shows nothing like that and ps -ef shows what is running on the system not what PID is being issued to a new process. (That was the qeustion) Starting a new process and seeing what its PID is is the best way to do it and cat is a simple process to use (you could use plenty of others) Having it hang helps see the PID without pressure of making sure it is still running while you do it

  • mo79ukmo79uk Posts: 18

    It might be better worded as 'Start some processes and note what their PIDs are' as as it is it seems to imply checking what the PIDs are of processes that have recently already launched.

Sign In or Register to comment.