SMJobRemove成功,但plist和帮助工具未删除 [英] SMJobRemove succeeds, but plist and helper tool not deleted

查看:262
本文介绍了SMJobRemove成功,但plist和帮助工具未删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图删除通过 SMJobBless 安装的特权帮助工具,我得到一个正返回值,没有错误,但是/ Library / PrivilegedTools和/ Library / LaunchDaemons不会被删除。



从我阅读的文档:


返回值如果作业已成功删除,则返回true否则
false。


我调用以下命令删除作业:
result = SMJobRemove(kSMDomainSystemLaunchd,(__bridge CFStringRef)label,_authRef,YES,& errorCF);

感谢 jatoben ,该线程有我正在寻找的答案。




SMJobRemove是等效的的launchctl remove。也就是说,它
从launchd中删除作业,但对磁盘没有任何影响。
因此,作业将在下次启动时重新加载。要获得
,你必须自己删除plist或者通过
fork / exec'inglaunchctl unload -w。



I'm trying to remove a privileged helper tool installed via SMJobBless, I'm getting a positive return value and no errors, yet the files at /Library/PrivilegedTools and /Library/LaunchDaemons are not deleted. Do I have to delete these files myself?

From the documentation I read:

Return Value true if the job was removed successfully, otherwise false.

I'm calling the following to remove the job: result = SMJobRemove(kSMDomainSystemLaunchd, (__bridge CFStringRef)label, _authRef, YES, &errorCF);

解决方案

Thanks jatoben, that thread had the answer I was looking for.

As suspected you do have to remove the files yourself or use the following: (Taken from Apple dev forums:)

SMJobRemove is the equivalent of "launchctl remove". That is, it removes the job from launchd but has no effect on the disk at all. Thus the job will get reloaded the next time you start up. To get around that you have to either remove the plist yourself or by fork/exec'ing "launchctl unload -w".

这篇关于SMJobRemove成功,但plist和帮助工具未删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆