site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Organization: Cylogistics Thread-index: Acm26nzZ3qR3xSnbR6ezQoFGwnGpVgAADbjg -----Original Message----- From: darwin-dev-bounces+witt=cylogistics.com@lists.apple.com [mailto:darwin-dev-bounces+witt=cylogistics.com@lists.apple.com] On Behalf Of darwin-dev-request@lists.apple.com Sent: Monday, April 06, 2009 12:04 PM To: darwin-dev@lists.apple.com Subject: Darwin-dev Digest, Vol 6, Issue 84 Send Darwin-dev mailing list submissions to darwin-dev@lists.apple.com To subscribe or unsubscribe via the World Wide Web, visit http://lists.apple.com/mailman/listinfo/darwin-dev or, via email, send a message with subject or body 'help' to darwin-dev-request@lists.apple.com You can reach the person managing the list at darwin-dev-owner@lists.apple.com When replying, please edit your Subject line so it is more specific than "Re: Contents of Darwin-dev digest..." Today's Topics: 1. Re: Run daemon from installer as root (Iceberg-Dev) 2. Re: Run daemon from installer as root (Rakesh Singhal) 3. Re: Are kqueue events "round robin"? (P?hl Melin) 4. Re: Run daemon from installer as root (Rakesh Singhal) 5. Double Fault Causes? (Duane Murphy) ---------------------------------------------------------------------- Message: 1 Date: Mon, 6 Apr 2009 00:54:41 +0200 From: Iceberg-Dev <dev.iceberg@gmail.com> Subject: Re: Run daemon from installer as root To: Darwin Dev <darwin-dev@lists.apple.com> Message-ID: <9E1D99CF-85BA-42C3-A264-B63A03474AEA@gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Apr 5, 2009, at 5:27 PM, Duane Murphy wrote:
--- At Sun, 5 Apr 2009 20:03:42 +0530, Rakesh Singhal wrote:
Hi all,
I have created an installer for my daemon application. I want my daemon to run as root after installation. Before installation I used to run daemon using "sudo launchctl load /Library/LaunchDaemons/ com.mycompany.mydaemon.plist". In installer I tried using run command or run script but it works only in 10.4.11 ppc but not with 10.5.4 intel. I want to set some file permissions/ownerships also but it doesnt work. Installer can be run only from admin users. Is there anyway to run daemon as root using command or script?
This is not a limitation of the installer. This is a limitation of the sh (and perl). Well, not really a limitation, it's a security feature. Some script interpreters will refuse to run a script as root as a security precaution. I don't recall the exact details about when this choice is made or how to overcome it.
My choice for overcoming the problem was to choose a different interpreter (python). I suppose it's just a matter of time before that door is closed also.
I'd like to know what the alternatives are so that scripts within an installer can be run with Administrator/root privileges.
Just in case, a simple solution is probably to: 1) Be sure that the installer requires an admon/root authentication. 2) Use sudo to call launchctl even from the shell script. ------------------------------ Message: 2 Date: Mon, 6 Apr 2009 12:25:51 +0530 From: Rakesh Singhal <rakesh.singhal@gmail.com> Subject: Re: Run daemon from installer as root To: duanemurphy@mac.com, darwin-dev@lists.apple.com Message-ID: <bbf18850904052355q42fa27aauace063307cbe036d@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Hi Duane, I am using InstallAnyWhere to create installer. I am trying using excuting commands or script but I am not able to do it. But I think, I will have to use "sudo launchctl load /Library/LaunchDaemons/com.mycompany.mydaemon.plist" to load my daemon and run it. Is it possible that when installer execute this command or script, it can pop-up for authentication? Please advice me. Regards Date: Sun, 5 Apr 2009 08:27:48 -0700 From: "Duane Murphy" <duanemurphy@mac.com> Subject: Re: Run daemon from installer as root To: "Darwin Dev" <darwin-dev@lists.apple.com> Message-ID: <20090405152748.1674996337@mini.internal.murphyslogic.com> Content-Type: text/plain; charset=ISO-8859-1 --- At Sun, 5 Apr 2009 20:03:42 +0530, Rakesh Singhal wrote:
Hi all,
I have created an installer for my daemon application. I want my daemon to run as root after installation. Before installation I used to run daemon using "sudo launchctl load /Library/LaunchDaemons/ com.mycompany.mydaemon.plist". In installer I tried using run command or run script but it works only in 10.4.11 ppc but not with 10.5.4 intel. I want to set some file permissions/ownerships also but it doesnt work. Installer can be run only from admin users. Is there anyway to run daemon as root using command or script?
This is not a limitation of the installer. This is a limitation of the sh (and perl). Well, not really a limitation, it's a security feature. Some script interpreters will refuse to run a script as root as a security precaution. I don't recall the exact details about when this choice is made or how to overcome it. My choice for overcoming the problem was to choose a different interpreter (python). I suppose it's just a matter of time before that door is closed also. I'd like to know what the alternatives are so that scripts within an installer can be run with Administrator/root privileges. ...Duane
participants (1)
-
Don Witt