SMJobRemove succeeds but plist and helper tool are not removed

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

From the documentation I read:

The return value is true if the job was successfully deleted, otherwise false.

I call the following to delete the job: result = SMJobRemove(kSMDomainSystemLaunchd, (__bridge CFStringRef)label, _authRef, YES, &errorCF);

+5
source share
2 answers

Thanks jatoben , this thread got the answer I was looking for.

As expected, you need to delete the files yourself or use the following: (Dismissed from the Apple dev forums :)

SMJobRemove is the equivalent of "launchctl remove". That is, it removes the task from launchd, but does not affect the drive at all. Thus, the work will be restarted at the next start. To get around, you must either remove plist yourself, or fork / exec'ing "launchctl unload -w".

+1
source
0
source

Source: https://habr.com/ru/post/921556/


All Articles