Skip to main content
Question

Enable Location Service with SIP


anverhousseini
Forum|alt.badge.img+11

Hi Jamf Nation

I'm trying to programmatically enable the location service. I have done this so far:

#!/bin/bash

/usr/bin/defaults write "/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd" LocationServicesEnabled -int 1
/usr/sbin/chown -R _locationd:_locationd "/var/db/locationd"

exit 0

As since macOS 10.12.2 SIP does not allow to reload the com.apple.locationd.plist LaunchDaemon a reboot is necessary. But it does not even work after a reboot. I do have enabled Wi-Fi.

Any ideas?

5 replies

Forum|alt.badge.img+5
  • New Contributor
  • 29 replies
  • August 10, 2017

Not sure why you’re having issues to be honest as I’ve not tested what you’re doing but if you want to reload launch daemons or agents without rebooting you should be able to do this in the command line as the root user and by running this;

launchctl unload -w /path/to/launchdaemon

Then to reload it:

launchctl load -w /path/to/launchdaemon

If you want to check a launch daemon is running then as the root user run this:

launchctl list

Hopefully that at least helps in some way.

Rob


Forum|alt.badge.img+14
  • Valued Contributor
  • 107 replies
  • August 11, 2017

@anverhousseini The post below might help you out.

Enable Location Services


Forum|alt.badge.img+8
  • Contributor
  • 147 replies
  • August 11, 2017

anverhousseini
Forum|alt.badge.img+11
  • Author
  • Valued Contributor
  • 98 replies
  • August 15, 2017

@r0blee It is not possible to reload LaunchDaemons which are protected by SIP since 10.12.2

@StoneMagnet Thank you, I already saw that thread, but this doesn't work anymore.


Forum|alt.badge.img+5
  • New Contributor
  • 29 replies
  • August 15, 2017

@anverhousseini good shout. With the exception of the updatesettings launch daemon the rest are indeed protected in /System/Library/LaunchDaemons/


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings