launchctl list 的状态列中的数字代表什么意思?

launchctl list 的状态列中的数字代表什么意思?

launchctl 在 launchctl list 输出中有一个“状态”列。手册页或任何相关的 launchd 手册页均未提及此列或其含义。

答案1

这是该服务的最后退出代码。

手册launchctl页对此进行了描述。

 list [-x] [label]
          With no arguments, list all of the jobs loaded
          into launchd in three columns. The first column
          displays the PID of the job if it is running.
          The second column displays the last exit status
          of the job. If the number in this column is
          negative, it represents the negative of the
          signal which killed the job.  Thus, "-15" would
          indicate that the job was terminated with
          SIGTERM. The third column is the job's label.

相关内容