1

Is there an equivalent of pstop in OSX?

How is pstop different to kill?

1 Answer 1

0

Is there an equivalent of pstop in OS X?

Yes. Send SIGSTOP to the process you want temporarily stopped.

The most direct way to do that is kill -STOP $pid, but you can use any of the several other methods for sending a signal from the command line on OS X: pkill, killall or /bin/kill.

(The latter as opposed to the shell builtin, that being what you normally get when you issue a kill command on OS X. Say help kill to see the differences with respect to man kill.)

How is pstop different to kill?

If by "kill" you mean the default action, kill -TERM, the difference is that the STOP signal just suspends the process, ready to be started again later. It's the same thing that happens to an interactive process when you hit Ctrl-Z from a modern shell.

(That feature is part of a larger group of features called job control which was introduced in BSD Unix as part of the C shell, then later cloned in the Korn shell, which in turn was forked to become the POSIX shell. That is why Ctrl-Z works in the default interactive shell in almost every Unix or Unix-like system: because POSIX.)

When you want to resume the process, send it SIGCONT.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .