I start application within python using subprocess module, so this application appears in Activity Monitor utility under roots "launchd.
cmd = "/usr/bin/sudo -H -u "+ self.getCurrentUserName() + "-P" + +os.path.join(dir, app) + app_args
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
When application is start开发者_Python百科ed manually via Terminal it works ok and it appears under current users "launchd". Is it possible to launch applications under current users "launchd" within python?
I'm running OS X 10.6.
When you run a command as sudo, it will always show up as belonging to root, that is what sudo does...
--Dave
精彩评论