glance-control exits with 0 when glance-<server> script is not found
Bug #817032 reported by
Jason Kölker
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Low
|
Eoghan Glynn |
Bug Description
If a glance-<server> script does not exist in ./bin glance-control exits with a 0 status:
$ ls -la bin/glance-scrubber
ls: cannot access bin/glance-
$ ./bin/glance-
Unable to increase file descriptor limit. Running as non-root?
Starting glance-scrubber with /home/jkoelker/
$ echo $?
0
Changed in glance: | |
milestone: | diablo-4 → diablo-rbp |
Changed in glance: | |
milestone: | diablo-rbp → 2011.3 |
Changed in glance: | |
milestone: | 2011.3 → none |
assignee: | Jay Pipes (jaypipes) → nobody |
Changed in glance: | |
importance: | Medium → Low |
Changed in glance: | |
assignee: | nobody → Eoghan Glynn (eglynn) |
Changed in glance: | |
milestone: | none → essex-4 |
Changed in glance: | |
status: | Fix Committed → Fix Released |
Changed in glance: | |
milestone: | essex-4 → 2012.1 |
To post a comment you must log in.
111 def launch(ini_file, pid_file): nullfile. fileno( ), desc) file(pid_ file, pid)
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.