81

Getting a error while executing the plist file in terminal

ERROR : Path had bad ownership/permissions

1) I created a plist file using xcode 6 and saved the plist file in path library/launchdaemons/myfile.plist

myfile.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>myfile</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Desktop/myscript.sh</string>
    </array>
    <key>StartCalendarInterval</key>
    <array>
        <dict>
            <key>Hour</key>
            <integer>14</integer>
            <key>Minute</key>
            <integer>35</integer>
        </dict>
    </array>
</dict>
</plist>

2) In terminal i used the sudo launchctl load command to load the plist file

sudo launchctl load /library/launchdaemons/myfile.plist

3) After that i am getting this error

/Library/LaunchDaemons/myfile.plist: Path had bad ownership/permissions

Where i am going wrong ?

3 Answers 3

147

Try changing the ownership of the .plist file:

sudo chown root /Library/LaunchDaemons/myfile.plist
sudo chgrp wheel /Library/LaunchDaemons/myfile.plist

or more simply, change the user and group in one command:

sudo chown root:wheel /Library/LaunchDaemons/myfile.plist

It is also worth noting that these root LaunchDaemons can't be world writable, for security reasons:

sudo chmod o-w /Library/LaunchDaemons/*
6
  • ya this was the right solution but before 4 days oly i got the solution anyway thank you
    – vivek
    Jan 28, 2015 at 8:31
  • @Vivek you should have shared your solution then.
    – MatterGoal
    Jun 10, 2020 at 7:09
  • @MatterGoal: I was unable to access Stackoverflow on those 4 days when I came back here, I saw the solution posted.
    – vivek
    Jun 23, 2020 at 9:16
  • The permissions error I faced on dansketcher.com/2021/03/30/shmmax-error-on-big-sur was resolved by this answer. Thanks! 73 de W2IVV/VU3TTL
    – Parth Sane
    Feb 10, 2022 at 4:39
  • staff group is working for me, but the file must not be group writable Jul 7, 2022 at 8:48
20

The plist file must be owned by root and group wheel as rw only for owner. So root:wheel 600

2
  • 2
    This was crucial for resolving the issue Jul 26, 2020 at 8:19
  • mine runs when its group readable with group staff (i.e. 640) Jul 7, 2022 at 8:47
7

In addition to the above

sudo chmod 600 /directoryToFile/filename.plist

for example:

sudo chmod 600 com.backup.plist

or

sudo chmod 600 /Library/LaunchDaemons/myfile.plist
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.