Pid can be a pid or a string.