i trying create process on mac nohup. process created terminated after creation. process has command /usr/bin/wget http://local.domain/some.php. error /var/log/system.log
(0x7fed9c80a940.anonymous.nohup[23454]): bug: 12e55: launchd + 67394 [7dcc9489-2df5-3807-83fa-ef5666ee8078]: 0x0 (0x7fed9c80a940.anonymous.nohup[23454]): switching sessions not allowed in system mach bootstrap. (0x7fed9c80a940.anonymous.nohup[23454]): _vprocmgr_switch_to_session(): kr = 0x44c i stucked few days now.
process created , executed on linux fine.
it's problem of context, think. osx isn't linux, it's based on bsd, it's more clone/distro. in it's core, there's mach kernel, giving dos (as in denial of service) treatment. got line:
switching sessions not allowed in system mach bootstrap the problem, think, way mach treats bootstrap context. nohup implies executed command can/may survive past logout in case. when using wget, not compute:
in mach, bootstrap task assigned responsibility looking requests mach ports. part of effort, each mach task registered in 1 of 2 groups—either in startup context or user’s login context
you're forking child using nohup in login context is, last time checked, cleaned-up (sort of autoreleasepool-style) after logout. doesn't work, it?
what's more: you're dealing php, responds requests, yet @ same time, forked child process may outlive context manages these requests. hence, affects use of nohup:
contexts pose issue users running background jobs nohup or users detaching terminal sessions using screen. there times when reasonable program survive past logout, default, not occur.
bascially, because you're running process login context, child process automatically runs in same (login) context. in case, you're responsable child process, nohup implies may outlive context, nobody responsable process, can harmful. requires context startup. sort of risky. haven't found clear-cut way around it, su[do] doesn't help, because has no impact on context.
way can think of write script/daemon runs in startup context, , idle's, waiting pass command it, because daemon running in startup context fork child processes in own (startup) context. gather that's how httpd works, anyway
either that, or create third context, couldn't tell how safely that...
source: osx kernel programming guide
Comments
Post a Comment