Hmm, interesting. This code was copied from Swift. You can assign this
to me, Jason, and I'll take care of it. Swift has updated a lot of
that code in the past year or so; I'll check out clayg's new hotness.
-jay
On Wed, Jul 27, 2011 at 10:57 AM, Jason Kölker <email address hidden> wrote:
> 111 def launch(ini_file, pid_file):
> 112 args = [server, ini_file]
> 113 print 'Starting %s with %s' % (server, ini_file)
> 114
> 115 pid = os.fork()
> 116 if pid == 0:
> 117 os.setsid()
> 118 with open(os.devnull, 'r+b') as nullfile:
> 119 for desc in (0, 1, 2): # close stdio
> 120 try:
> 121 os.dup2(nullfile.fileno(), desc)
> 122 except OSError:
> 123 pass
> 124 try:
> 125 os.execlp('%s' % server, server, ini_file)
> 126 except OSError, e:
> 127 sys.exit('unable to launch %s. Got error: %s'
> 128 % (server, str(e)))
> 129 sys.exit(0)
> 130 else:
> 131 write_pid_file(pid_file, pid)
>
> Since it forks, the parent exits successfully and the exception that
> gets caught happens in the child.
>
> --
> You received this bug notification because you are a member of Glance
> Bug Team, which is subscribed to Glance.
> https://bugs.launchpad.net/bugs/817032
>
> Title:
> glance-control exits with 0 when glance-<server> script is not found
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/glance/+bug/817032/+subscriptions
>
Hmm, interesting. This code was copied from Swift. You can assign this
to me, Jason, and I'll take care of it. Swift has updated a lot of
that code in the past year or so; I'll check out clayg's new hotness.
-jay
On Wed, Jul 27, 2011 at 10:57 AM, Jason Kölker <email address hidden> wrote: nullfile. fileno( ), desc) file(pid_ file, pid) /bugs.launchpad .net/bugs/ 817032 /bugs.launchpad .net/glance/ +bug/817032/ +subscriptions
> 111 def launch(ini_file, pid_file):
> 112 args = [server, ini_file]
> 113 print 'Starting %s with %s' % (server, ini_file)
> 114
> 115 pid = os.fork()
> 116 if pid == 0:
> 117 os.setsid()
> 118 with open(os.devnull, 'r+b') as nullfile:
> 119 for desc in (0, 1, 2): # close stdio
> 120 try:
> 121 os.dup2(
> 122 except OSError:
> 123 pass
> 124 try:
> 125 os.execlp('%s' % server, server, ini_file)
> 126 except OSError, e:
> 127 sys.exit('unable to launch %s. Got error: %s'
> 128 % (server, str(e)))
> 129 sys.exit(0)
> 130 else:
> 131 write_pid_
>
> Since it forks, the parent exits successfully and the exception that
> gets caught happens in the child.
>
> --
> You received this bug notification because you are a member of Glance
> Bug Team, which is subscribed to Glance.
> https:/
>
> Title:
> glance-control exits with 0 when glance-<server> script is not found
>
> To manage notifications about this bug go to:
> https:/
>