我正试图写一封信
launchd agent
我创建了一个名为
com.mycompany.myapp.plist
/Library/LaunchAgents
{
LimitLoadToSessionType = "Aqua";
StartInterval = 10;
OnDemand = NO;
KeepAlive = YES;
RunAtLoad = YES;
Label = "com.mycompany.myapp";
Program = "/Users/thomi/myapp";
ProgramArguments = (
"/Users/thomi/myapp",
"-l",
"-d",
);
}
起初我没有
StartInterval
密钥集,因为我以为代理会自动启动。问题是,除非手动发出以下两个命令,否则代理不会启动:
launchctl load -S Aqua -D all
launchctl start com.mycompany.myapp
首先,当我跑的时候
launchctl list com.mycompany.myapp
{
"Label" = "com.mycompany.myapp";
"LimitLoadToSessionType" = "System";
"OnDemand" = true;
"LastExitStatus" = 0;
"TimeOut" = 30;
"Program" = "/Users/thomi/myapp";
ProgramArguments = (
"/Users/thomi/myapp",
"-l",
"-d",
);
};
请注意
LimitLoadToSessionType
参数已更改。
限制加载会话类型
属性已更改?