0

I am trying to launch a daemon using below and running into Path had bad ownership/permissions,how to fix this and launch and make sure it is running?

teambot47:wifi_bas_server username$ sudo launchctl load -w /Users/username/wifi-automation/technology_version_report/com.company.internal.technologyreport.daily.plist 
/Users/username/wifi-automation/technology_version_report/com.company.internal.technologyreport.daily.plist: Path had bad ownership/permissions

Following are the permissions on the plist

teambot47:wifi_bas_server username$ ls -lrta /Users/username/wifi-automation/technology_version_report/com.company.internal.technologyreport.daily.plist
-rwxrwxrwx  1 username  staff  811 May 17 15:38 /Users/username/wifi-automation/technology_version_report/com.company.internal.technologyreport.daily.plist
Jeremyapple
  • 253
  • 2
  • 6
  • 20
  • I'm not sure of the exact requirements, but daemon config files at least need to be owned by root, and I think they can't have write access for any other users or groups; there may also be restrictions on the directories in the path to them. In general, daemon files should be installed in /Library/LaunchDaemons, not somewhere in a user's home directory. – Gordon Davisson Jun 01 '18 at 01:09
  • @GordonDavisson - When I run `launchctl list | grep com.company.internal.firmwarereport.daily` I get the output `- 1 com.apple.internal.firmwarereport.daily` ,what does this mean?does it mean its already loaded?how would I know if its loaded or not? – Jeremyapple Jun 01 '18 at 01:22
  • `launchctl list` (without `sudo`) lists agents (which run under a user account when that user is logged in), not daemons (which generally run as root, independent of who's logged in). `sudo launchctl load` tries to load it as a daemon. Which are you trying to run it as? Also, that output seems to indicate that it's loaded as an agent, tried to run, but exited with an error status (the "1"). – Gordon Davisson Jun 01 '18 at 01:52
  • To clarify, I have a plist ,I want to load it as a daemon and also check its status whether its running or not ...how do I do that? – Jeremyapple Jun 01 '18 at 02:04
  • 1
    Simplest, most reliable way: first unload it as an agent (`launchctl unload -w /path/to/file.plist` -- no `sudo`), move it into /Library/LaunchDaemons, change owner and group to root:wheel and permissions to 644, then reboot. – Gordon Davisson Jun 01 '18 at 02:52

0 Answers0