launchd

Making Mac OSX launchctl launch a process as root on startup

守給你的承諾、 提交于 2019-12-03 01:09:09
My question is how to make a MacOSX daemon process using launchd start with root privileges automatically after a reboot? I'm writing an application for in house use that blocks access to web sites. It is written in python and modifies the /ect/hosts file to disable or enable listed urls. The main application is in django and I created a python twisted daemon that does the actual modification of the /etc/hosts file as root access privileges are required. I have created a plist file which works with one minor issue. After rebooting the daemon process has my normal logon privileges instead of

OSX launchd plist for node forever process

让人想犯罪 __ 提交于 2019-12-02 21:06:37
I am trying to write a launchd.plist file for my node server. I am using forever to run my node server. I would like the server to start on boot. I would also like to wait for the mongodb launchd plist to run first. I installed mongobb using homebrew and it came with a launchd.plist already. I have executed the following: $ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist plist for mongodb is: <!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>homebrew.mxcl.mongodb</string

what does launchd status 78 mean?? why my user agent not running??

别等时光非礼了梦想. 提交于 2019-12-02 17:56:48
I want to run a unison sync service running in the background whenever I login. But the status code of my agent is 78 . I don't know why, I tried some fix posted online, but it just doesn't work. What's the problem?? below is the plist file for my service. <?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>syncmyproject</string> <key>StandardOutPath</key> <string>/var/log/syncmyproject.log</string> <key>StandardErrorPath</key> <string>/var/log

OS X - Truly 'On Demand' Privileged Helper Tool

前提是你 提交于 2019-12-02 12:43:33
问题 My application needs to write files to restricted places on the filesystem. To do so, I use a helper tool that is run as root. Everything is working correctly, following this example, my helper tool is correctly installed and run. I use this solution to be able to "wake" the helper tool, otherwise it isn't launched more than one time after initial load. The helper tool is waiting for messages to come from the main application, and executes them correctly. I also have a kind of message that

Binding on privileged ports (ports < 1024) on Mac OS X 10.6

心不动则不痛 提交于 2019-12-01 14:31:18
问题 Do you know how to remove restriction on binding to ports < 1024 with a user account that is not root on Mac OS X? 回答1: The best way is to leverage launchd . The restriction on binding to ports < 1024 will still be there and is not likely to go anywhere, but if your app requests elevated privileges once in order to add the necessary launchd configuration, then you can let launchd do the actual listening on the privileged port and pass the socket to your app when appropriate. See the section

texi2dvi() error when running a .Rnw script with LaunchControl

孤者浪人 提交于 2019-12-01 10:26:14
I'm trying to compile a knitr script on a timer using LaunchControl (a launchd GUI for scheduling cron-like jobs on OSX). I have a dispatcher.R script that does this: #!/Library/Frameworks/R.framework/Resources/Rscript library("knitr") setwd("~/somedirectory") knit2pdf("my_script.Rnw", output= "my_script.tex") When I run it interactively from in RStudio, my_script.Rnw works great. I get the desired PDF output. However, when launchd runs the dispatcher.R script I get this error: Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet, : Running 'texi2dvi' on 'my_script.tex'

texi2dvi() error when running a .Rnw script with LaunchControl

巧了我就是萌 提交于 2019-12-01 07:12:29
问题 I'm trying to compile a knitr script on a timer using LaunchControl (a launchd GUI for scheduling cron-like jobs on OSX). I have a dispatcher.R script that does this: #!/Library/Frameworks/R.framework/Resources/Rscript library("knitr") setwd("~/somedirectory") knit2pdf("my_script.Rnw", output= "my_script.tex") When I run it interactively from in RStudio, my_script.Rnw works great. I get the desired PDF output. However, when launchd runs the dispatcher.R script I get this error: Error in

How can I stop the Pow server from starting up at computer boot (OS X)?

五迷三道 提交于 2019-11-30 22:50:00
TL;DR: Is there a way to disable the Pow server from starting when my machine boots up, but retain the ability to launch the server manually via powder up when I need it to run? I am using Pow for my local development (and managing via the Powder gem ). I'd like to set up Pow so that the server isn't started automatically on boot, as running it drains my battery life and I'm not always coding. Pow has added itself to launchd and I can't seem to get to a scenario where the Pow server is not running after startup, but can still be run via a powder up or other equivalent command when I need to

Can SMJobSubmit() be used to execute a privileged helper installed by SMJobBless?

老子叫甜甜 提交于 2019-11-30 15:29:45
问题 I have been reading documentation and the SMJobBless example and various discussions on the Internet. My app now installs a privileged helper using SMJobBless() , but the helper doesn't run at all. The whole purpose of the helper is to load a kext, an important component of my app, whenever the application starts. I have seen examples showing that trying to connect to the helper through XPC will launch the helper, but I would like to keep my helper simple and dumb. The API doc shows that

Can SMJobSubmit() be used to execute a privileged helper installed by SMJobBless?

喜你入骨 提交于 2019-11-30 14:11:17
I have been reading documentation and the SMJobBless example and various discussions on the Internet. My app now installs a privileged helper using SMJobBless() , but the helper doesn't run at all. The whole purpose of the helper is to load a kext, an important component of my app, whenever the application starts. I have seen examples showing that trying to connect to the helper through XPC will launch the helper, but I would like to keep my helper simple and dumb. The API doc shows that there is a SMJobSubmit() function. What exactly does it do? Can I use it to launch the privileged helper