假设我有一个基于哪个操作系统的go项目,在某些情况下,我想使用的是一个Systemd客户端软件包与一个Upstart客户端软件包相比一个sysv客户端软件包与一个launchd客户端软件包.是否有可能有选择地导入每个包,所以我只导入我正在构建的OS /发行版所需的那个?或者我是否必须导入每个OS /发行版的每个包?
'at' 是一个 UNIX/BSD/Linux 编程工具,我在调度一些操作预测模型时使用它。在我的 Mac 笔记本电脑上测试我的一些脚本时,我发现该at工具毫无错误地接受了作业提交,并将它们报告在队列中,但最终没有执行它们。
at由于该工具的名称很普通,因此很难为该工具搜索有用的答案。但是,我看到OSX El Capitan 上的 crontab 是否损坏?在努力解决这个问题的同时。
$ at now + one minute
echo "hello world" |say
^D
$ atq # list at jobs...
7 Mon Mar 13 14:31:00 2017
$
Run Code Online (Sandbox Code Playgroud) 我的Mac Mini上的系统日志在系统日志中显示此错误:
Mar 7 17:51:18 My-Mac-mini com.apple.launchd[1] (org.mongodb.mongod[432]): posix_spawn("/opt/local/bin/mongod", ...): No such file or directory
Mar 7 17:51:18 My-Mac-mini com.apple.launchd[1] (org.mongodb.mongod[432]): Exited with code: 1
Mar 7 17:51:18 My-Mac-mini com.apple.launchd[1] (org.mongodb.mongod): Throttling respawn: Will start in 10 seconds
我使用Brew安装了MONGODB,它运行正常.
我已经使用LOCATE来尝试跟踪启动PLIST的来源(我猜).
如何跟踪Apple的"launchd"试图运行的来源?
我一直在尝试设置一个脚本来定期运行python程序launchd.python程序失败,因为它无法找到我的导入---我知道这是因为我在日志文件中捕获了错误.为了解决这个问题,我在那里创建~\.MacOSX\environment.plist并复制了我PYTHONPATH,注销并再次登录.这似乎不足以解决问题,我不知道还有什么可以尝试.
我正在运行OSX,10.8.3.
相关主题:
更新:
看来我可以运行以下命令:
launchctl setenv PYTHONPATH $PYTHONPATH
Run Code Online (Sandbox Code Playgroud)
并且脚本将成功执行.所以,修改我的问题:
~\.launchd.conf和\etc\.launchd.conf,也不存在了.launchd找到它?我正在尝试在OS X Mountain Lion 10.8.3中安排一个简单的任务
launchctl start nextstopsun.helloworld
Run Code Online (Sandbox Code Playgroud)
命令不执行脚本并将消息抛出到控制台
4/2/13 9:50:49.663 PM com.apple.launchd.peruser.501[139]: (nextstopsun.helloworld[46729]) Job failed to exec(3) for weird reason: 8
Run Code Online (Sandbox Code Playgroud)
我的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>nextstopsun.helloworld</string>
<key>Program</key>
<string>/Users/nextstopsun/Work/scripts/hw.sh</string>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>21</integer>
<key>Minute</key>
<integer>15</integer>
</dict>
<key>UserName</key>
<string>nextstopsun</string>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)
脚本也很简单
echo "Hello World!" > hw.log
Run Code Online (Sandbox Code Playgroud)
launchctl加载它没有错误.从shell执行脚本时,它按预期工作.注销并重新登录无济于事.在Google中没有找到任何答案.什么是"奇怪的原因:8"都是关于什么的?
我将以下com.apple.test.plist文件放置在该文件夹中:
/系统/库/启动守护程序
<?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>com.apple.Spotlight</string>
<key>ProgramArguments</key>
<array>
<string>/Users/todd/Dropbox/client/CLIENT.BUILDS/MAC/v0.1/ApplicationTest.app</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)
但是由于某种原因,当我使用用户todd登录时,ApplicationTest.app无法启动。
有任何想法吗?
我的路由器指示我运行的应用程序已打开一个TCP端口(6183)(我不知道)
使用lsof(在这里回答)lsof -iTCP:6183 -sTCP:LISTEN,我发现launchd是罪魁祸首.
是否有可能找出launchd的'脚本'中的哪一个负责?
我不太确定我在寻找什么有资格作为...代理、守护程序,或者只是一个没有 GUI 运行的小型后台应用程序。
我编写了一个在终端中运行的小型 obj-c 程序。它需要不断检查数据库中的值,并且每秒进行大约 2 次调用。我已经让它工作了,我只是不知道如何构建这个东西来发布......
理想情况下,我希望用户能够像普通 Mac 应用程序一样安装它,但我不确定这是否可行。我正在寻找类似于 Dropbox 在后台运行并通知用户新文件的方式,或者 LogMeIn 如何在后台运行某些东西,或者我还有一个名为 Aurora 的应用程序,它有一个名为“Aurora”的后台进程唤醒助手”。这些是我试图用这个小的 obj-c 程序模仿的例子。
我将如何构建它以在 Xcode 5 中发布?
I am running the latest Apple OS X 10.10(.1) Yosemite, and the latest Adobe Coldfusion 11. Everything works ok, but the server does not startup automatically on startup. I can go into Terminal and use:
cd /Applications/ColdFusion11/cfusion/bin
sudo ./coldfusion start
Run Code Online (Sandbox Code Playgroud)
However the server is not on by default. How do I set it so that it launches every time the computer starts up?
我有以下的launchd配置(存储在acme.plist),该加载和开始使用launchctl load acme.plist和launchctl start acme.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>com.acme</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-jar /usr/local/acme/acme-latest.jar</string>
</array>
<key>StandardErrorPath</key>
<string>/tmp/acme-error</string>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)
每当我尝试运行它时,我会得到以下内容/tmp/acme-error:
Unrecognized option: -jar /usr/local/acme/acme-latest.jar
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Run Code Online (Sandbox Code Playgroud)
但是从bash运行时我绝对没有问题.有任何想法吗?