Questions tagged «launchctl»

launchctl是OS X启动系统的接口,用于加载或卸载守护程序或代理。

7
无法在Yosemite中使用launchctl启动守护程序
我在其中放置了一个启动的守护进程,~/Library/LaunchAgents该守护进程在Mavericks中运行良好。但这不会在优胜美地公开测试版中开始。守护程序plist就像这样(我的用户名darksair使用UID 501) <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd > <plist version="1.0"> <dict> <key>Label</key> <string>org.darksair.retrmail</string> <key>ProgramArguments</key> <array> <string>/Users/darksair/bin/retrmail.py</string> </array> <key>KeepAlive</key> <false/> <key>StartInterval</key> <integer>300</integer> <key>LaunchOnlyOnce</key> <false/> <key>UserName</key> <string>darksair</string> <key>ProcessType</key> <string>Standard</string> <key>EnvironmentVariables</key> <dict> <key>PATH</key> <string>/Users/darksair/Python/bin:/Users/darksair/Python3/bin:/Users/darksair/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string> </dict> <key>StandardOutPath</key> <string>/Users/darksair/logs/retrmail.log</string> <key>StandardErrorPath</key> <string>/Users/darksair/logs/retrmail.log</string> </dict> </plist> 基本上应该~/bin/retrmail.py每5分钟运行一次。 我注意到在Yosemite中,launchd已升级到2.0,并且launchctl具有新命令。我试过了 sudo launchctl kickstart user/501/org.darksair.retrmail …



1
发射似乎忽略了优胜美地上的StartCalendarInterval
我尝试按启动时间及时更新Homebrew。我的plist文件显示在这里: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>ms.liu.homebrew.update</string> <key>UserName</key> <string>LiuMS</string> <key>ProcessType</key> <string>Background</string> <key>EnvironmentVariables</key> <key>ProgramArguments</key> <array> <string>/usr/local/bin/brew</string> <string>update</string> </array> <key>StartCalendarInterval</key> <dict> <key>Hour</key> <integer>20</integer> <key>Minute</key> <integer>0</integer> </dict> <key>StandardOutPath</key> <string>/usr/local/logs/ms.liu.homebrew.update.out</string> <key>StandardErrorPath</key> <string>/usr/local/logs/ms.liu.homebrew.update.err</string> </dict> </plist> 它确实以某种方式起作用:我可以launchctl start ms.liu.homebrew.update手动执行以更新我的Homebrew。但是,launchd不会定期执行此服务:stdout重定向到的文件的最后更改是在两天前。 我试图获取有关此服务的信息,但一无所获: > launchctl print user/%MyPID%/ms.liu.homebrew.update`` Could not find …

1
Mac os x 10.7.4进程限制
我有一个 709 最大用户进程。我想加倍它,或者更多。 第一:ulimit > ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 256 pipe size (512 bytes, -p) 1 stack size (kbytes, -s) …

2
launchctl:文件中的可疑所有权(跳过)(Mac OS X)
我最近安装了mysql并在我的.bash文件中添加了它的start命令。但是当我尝试运行命令时,就是在遇到这个错误的时候: launchctl:文件中的可疑所有权(跳过):/ Users / news / Library / LightsAgents / com.mysql.mysqld.plist没有找到加载 有谁知道它是什么?
4 mac  mysql  launchctl 

1
在雪豹上自动启动svnserve
注意:我最初是在服务器故障(https://serverfault.com/questions/148052/automatically-starting-svnserve-on-snow-leopard)上问这个问题的,但是我认为这可能是一个更合适的地方。 我已经在运行Snow Leopard的iMac上安装了Subversion,但无法使svnserve自动启动。据我了解(我对OSX仍然相当满意),最好的方法是利用启动。为此,我在/ Library / LaunchDaemons文件夹中创建了以下.plist文件。如果我使用launchctl执行此文件,则svnserve会按预期方式启动,但在系统启动或登录时不会自动启动。 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Disabled</key> <false/> <key>Label</key> <string>org.tigris.subversion.svnserve</string> <key>UserName</key> <string>Dave</string> <key>ProgramArguments</key> <array> <string>/opt/subversion/bin/svnserve</string> <string>--inetd</string> <string>--root=/Users/Shared/SVNrep</string> </array> <key>ServiceDescription</key> <string>Subversion Standalone Server</string> <key>Sockets</key> <dict> <key>Listeners</key> <array> <dict> <key>SockFamily</key> <string>IPv4</string> <key>SockServiceName</key> <string>svn</string> <key>SockType</key> <string>stream</string> </dict> <dict> <key>SockFamily</key> <string>IPv6</string> …

2
如果手动启动服务,是否可以通过启动停止服务?
我正在使用launchd在启动时启动mysql,它工作正常。我可以使用“ launchctl卸载”和“ launchctl加载”命令停止和启动服务。我也可以通过在终端中键入“ mysqld_safe”命令来启动服务。但是,如果我通过“ launchctl stop”停止服务,然后通过“ mysqld_safe”命令启动服务,则无法通过“ launchctl stop”停止服务。这可能吗?我在这里做错了什么? 我的清单是: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>mysql.service</string> <key>ProgramArguments</key> <array> <string>/path/to/mysql/bin/mysqld_safe</string> <string>--defaults-file=/path/to/mysql/my.cnf</string> <string>--port=3306</string> <string>--socket=/path/to/mysql/tmp/mysql.sock</string> <string>--datadir=/path/to/mysql/data</string> <string>--log-error=/path/to/mysql/data/mysqld.log</string> <string>--pid-file=/path/to/mysql/data/mysqld.pid</string> </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <false/> <key>UserName</key> <string>_mysql</string> <key>GroupName</key> <string>_mysql</string> <key>StandardOutPath</key> <string>/tmp/mysql_start.out</string> <key>StandardErrorPath</key> <string>/tmp/mysql_start.err</string> </dict> </plist> 通过终端启动mysql的命令是: …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.