歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> Launchctl - mac下的運行管理器

Launchctl - mac下的運行管理器

日期:2017/3/1 12:15:35   编辑:關於Linux

前面的文章提到了 launchctl,我就根據這個線索整理一下。

launchctl 是 launchd的控制台(也就是人機交互的終端)用於裝載進程、卸載進程並控制launchd。

launchctl 也就是launchd的封面,這麼說是為了避免讓人感到意外,說launchctl怎麼跑到launchd上了。

launchd時mac os最核心的系統組件之一。

Mac OS 系統啟動最先做的事就是運行launchd,由launchd完成其他的後續啟動工作。

launchd代碼已經開源,

1、launchd可以作為定時器使用,像linux下的 cron

2、launchd可以作為目錄監聽器,監聽目錄文件的變化

3、launchd可以根據配置啟動或者停止服務進程,這個用的最多。

launchd以plist文件作為配置輸入,文件格式見參考[2]和[3]

參考


[1]https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/launchctl.1.html

[2]https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html

[3]https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/plist.5.html

[4]http://paul.annesley.cc/2012/09/mac-os-x-launchd-is-cool/

[5]https://segmentfault.com/a/1190000000509514?utm_source=tuicool&utm_medium=referral#articleHeader4

Copyright © Linux教程網 All Rights Reserved