noob question you all can answer
Hi all I am trying to write a daemon, but I cannot seem to get it to load at boot time. On the system log, it says something to the effect of "dubious file permissions". I asked by accident on the cocoa mailing list, it they say it's because my plist in /Library/LaunchDaemon is not owned by the root with 644 permissions; but I have sudo'd, chmod'ed, chown'd to no avail. I cannot change ownership of the file to root. If this is the real problem, how do I fix it? If not, how do I fix it? Thanks Nathan
When I try "sudo chown root:wheel <my.plist>", there's no root password, but "ls -l" shows that the plist is still owned by the user:staff -----Original Message----- From: Shawn Erickson [mailto:shawnce@gmail.com] Sent: Monday, July 07, 2008 12:06 PM To: Nathan Wan Cc: launchd-dev@lists.macosforge.org Subject: Re: [launchd-dev] noob question you all can answer On Mon, Jul 7, 2008 at 11:48 AM, Nathan Wan <nlwan@nps.edu> wrote:
I cannot change ownership of the file to root.
What do you mean by this? How can you not change it? -Shawn
At 11:48 -0700 7/7/08, Nathan Wan wrote:
On the system log, it says something to the effect of "dubious file permissions". [...] If this is the real problem, how do I fix it? If not, how do I fix it?
Yes. The launchd plist file must be owned by root with an owning group of wheel. Also, it must not be writable by anyone other than root. Additionally, the daemon's code must follow the same rules. You can do this with the following commands: $ sudo chown root:wheel /Library/LaunchDaemons/com.example.MyDaemon.plist $ sudo chmod 644 /Library/LaunchDaemons/com.example.MyDaemon.plist $ sudo chown root:wheel /path/to/com.example.MyDaemon $ sudo chmod 755 /path/to/com.example.MyDaemon where: o "/Library/LaunchDaemons/com.example.MyDaemon.plist" is the path to your launchd property list file and o "/path/to/com.example.MyDaemon" is the path to your daemon. At 12:20 -0700 7/7/08, Nathan Wan wrote:
When I try "sudo chown root:wheel <my.plist>", there's no root password, but "ls -l" shows that the plist is still owned by the user:staff
Sounds like something has gone horribly wrong with <x-man-page://8/sudo>. What does the following print: $ sudo id Password: uid=0(root) gid=0(wheel) groups=0(wheel),1(daemon),2(kmem),8(procview),102(com.apple.sharepoint.group.2),29(certusers),3(sys),9(procmod),4(tty),1028(pseudousers),101(com.apple.sharepoint.group.1),80(admin),5(operator),300(dba),20(staff) If it doesn't list "uid=0(root) gid=0(wheel)" as the first entries, your sudo installation is broken. S+E -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
nothing prints after "Password:" no matter when command I type after sudo. For example, "sudo ls" has no output after "Password:", neither does "sudo id" How do I fix this? Thanks -----Original Message----- From: launchd-dev-bounces@lists.macosforge.org on behalf of Quinn Sent: Tue 7/8/2008 1:47 AM To: launchd-dev@lists.macosforge.org Subject: Re: [launchd-dev] noob question you all can answer At 11:48 -0700 7/7/08, Nathan Wan wrote:
On the system log, it says something to the effect of "dubious file permissions". [...] If this is the real problem, how do I fix it? If not, how do I fix it?
Yes. The launchd plist file must be owned by root with an owning group of wheel. Also, it must not be writable by anyone other than root. Additionally, the daemon's code must follow the same rules. You can do this with the following commands: $ sudo chown root:wheel /Library/LaunchDaemons/com.example.MyDaemon.plist $ sudo chmod 644 /Library/LaunchDaemons/com.example.MyDaemon.plist $ sudo chown root:wheel /path/to/com.example.MyDaemon $ sudo chmod 755 /path/to/com.example.MyDaemon where: o "/Library/LaunchDaemons/com.example.MyDaemon.plist" is the path to your launchd property list file and o "/path/to/com.example.MyDaemon" is the path to your daemon. At 12:20 -0700 7/7/08, Nathan Wan wrote:
When I try "sudo chown root:wheel <my.plist>", there's no root password, but "ls -l" shows that the plist is still owned by the user:staff
Sounds like something has gone horribly wrong with <x-man-page://8/sudo>. What does the following print: $ sudo id Password: uid=0(root) gid=0(wheel) groups=0(wheel),1(daemon),2(kmem),8(procview),102(com.apple.sharepoint.group.2),29(certusers),3(sys),9(procmod),4(tty),1028(pseudousers),101(com.apple.sharepoint.group.1),80(admin),5(operator),300(dba),20(staff) If it doesn't list "uid=0(root) gid=0(wheel)" as the first entries, your sudo installation is broken. S+E -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware _______________________________________________ launchd-dev mailing list launchd-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/launchd-dev
On Tue, Jul 8, 2008 at 6:16 PM, Wan, Nathan (CIV) <nlwan@nps.edu> wrote:
nothing prints after "Password:" no matter when command I type after sudo. For example, "sudo ls" has no output after "Password:", neither does "sudo id" How do I fix this?
I'm late to this discussion, but presumably you're typing in your password when prompted, and pressing return? Hamish
Thanks everyone, turns out all I needed to do was enable the root user. -----Original Message----- From: Hamish Allan [mailto:hamish@gmail.com] Sent: Tue 7/8/2008 11:04 AM To: Wan, Nathan (CIV) Cc: Quinn; launchd-dev@lists.macosforge.org Subject: Re: [launchd-dev] noob question you all can answer On Tue, Jul 8, 2008 at 6:16 PM, Wan, Nathan (CIV) <nlwan@nps.edu> wrote:
nothing prints after "Password:" no matter when command I type after sudo. For example, "sudo ls" has no output after "Password:", neither does "sudo id" How do I fix this?
I'm late to this discussion, but presumably you're typing in your password when prompted, and pressing return? Hamish
participants (5)
-
Hamish Allan
-
Nathan Wan
-
Quinn
-
Shawn Erickson
-
Wan, Nathan (CIV)