5

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);

redshift5
  • 1,966
  • 1
  • 18
  • 27
  • Any luck? I'm in the same boat. – Joe Sep 21 '12 at 22:38
  • This question is related. http://stackoverflow.com/questions/11699992/can-smjobsubmit-be-used-to-execute-a-privileged-helper-installed-by-smjobbless/11822408#comment16953899_11822408 The blog post attached to it, http://www.stairways.com/blog/2012-08-06-smjobsubmit might also have some leads. – Joe Sep 25 '12 at 13:08
  • Unfortunately I have not yet found anything regarding smjobremove not physically removing the files. If anyone knows a direct answer that would be great :) – redshift5 Oct 04 '12 at 01:06
  • See this [Apple Dev Forums thread](https://devforums.apple.com/message/732683#732683) (developer account required). – jatoben Oct 05 '12 at 19:21

2 Answers2

2

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".

redshift5
  • 1,966
  • 1
  • 18
  • 27
0

Have you seen https://github.com/brenwell/SMJobBless-Demo/blob/master/Uninstall.sh? It was very helpful for me.