Re: Run daemon from installer as root
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=nAkh/FVbgVg/eJ3TcMTnEEeclZ2G0dkgX9erfhvVuuo=; b=MitDGyb4rilMUWM2coI3/rF5/z3uHAeNEOiCtb3SsiqkaxBLHExmuqAyFn0axIbcyr 70I1vxvkKUUN/IGyjd6AJLDgYQ3CoYs3bAhJ/WKX+cl2V/9ZfCKNE0ehlJ23Mc94joUr FsqcAqc+gXV7DJgfdt8V9GIDZPtpyxZKkUXw8= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=kDveNTnAC+GdxnvWZlbTcm1ZF2K6OycEJeqb6SB8lNiRtOpNNSTld1AJjGOXTMh7dJ +n3huzA5N49f2tfpp/3zpnkf2BeYcViPD5JkfpI6B4OIdpza+Z3brrItAB6Fwfk2YN5+ fVVbvstmh2Bg9QXrzf3Nqgx9IRYo2KHy8FgRk= --- At Sun, 5 Apr 2009 20:03:42 +0530, Rakesh Singhal wrote: Hi all, 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. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com 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?
participants (1)
-
Rakesh Singhal