Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 934631 Details for
Bug 1135617
AVC denied messages when creating new gears
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
/usr/sbin/oo-httpd-singular
oo-httpd-singular (text/plain), 3.42 KB, created by
Brenton Leanhardt
on 2014-09-04 20:41:29 UTC
(
hide
)
Description:
/usr/sbin/oo-httpd-singular
Filename:
MIME Type:
Creator:
Brenton Leanhardt
Created:
2014-09-04 20:41:29 UTC
Size:
3.42 KB
patch
obsolete
>#!/bin/env oo-ruby > >#-- ># Copyright 2012 Red Hat, Inc. ># ># Licensed under the Apache License, Version 2.0 (the "License"); ># you may not use this file except in compliance with the License. ># You may obtain a copy of the License at ># ># http://www.apache.org/licenses/LICENSE-2.0 ># ># Unless required by applicable law or agreed to in writing, software ># distributed under the License is distributed on an "AS IS" BASIS, ># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ># See the License for the specific language governing permissions and ># limitations under the License. >#++ > ># Serialize and coalesce requests to reload/restart Apache. ># ># oo-httpd-singular will deliver either the reload or restart command ># to Apache. As simultaneous and multiple calls can become extremely ># expensive; the requests are serialized behind a lock file. Multiple ># requests; typically queuing up while one request is running will be ># coalesced into a single restart or reload. > >require 'rubygems' >require 'daemons' >require 'optparse' >require 'open4' >require 'thread' >require 'tempfile' >require 'json' >require 'openshift-origin-node/utils/shell_exec' > >HTTPD_SYSTEM="apachectl" >HTTPD_CMDS=["graceful"] >HTTPD_PRE_CMDS=["configtest"] >LOCKFILE=File.join(Dir::tmpdir,"httpd_singular.lock") >REQPREFIX="httpd_singular.req" > >def single_instance(&block) > File.open(LOCKFILE, File::CREAT|File::TRUNC|File::RDWR, 0640) do |f| > f.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) > begin > f.flock(File::LOCK_EX) > block.call > ensure > f.flock(File::LOCK_UN) > end > end >end > > >def load_reqset(reqset=[]) > reqfilter="#{REQPREFIX}.#{ARGV[0]}." > > Dir.foreach(Dir::tmpdir) do |dent| > next if dent[0,reqfilter.length] != reqfilter > fpath=File.join(Dir::tmpdir,dent) > next if File.size(fpath) != 0 > reqset << fpath > end > reqset.uniq >end > > >$OPTIONS = {} >OptionParser.new do |opts| > opts.banner = "\nUsage: #{$0} [-b] [#{HTTPD_CMDS.join('|')}]\n" + > "\nExample: #{$0} graceful\n" > > $OPTIONS[:background] = false > opts.on('-b', '--[no-]background', 'Run in the background and ignore return status.') do |bg| > $OPTIONS[:background] = bg > end > > opts.on('-h', '--help', 'Show this message') do > puts opts > exit > end >end.parse! > > >if ! HTTPD_CMDS.include?(ARGV[0]) > warn("Command must be one of: #{HTTPD_CMDS.join(' ')}") > exit(false) >end > ># Create the request >reqfile = Tempfile.new("#{REQPREFIX}.#{ARGV[0]}.XXXXXX") >reqfile.sync = true > >if $OPTIONS[:background] > Daemons.daemonize >end > ># Process all requests and get our output back >rc=0 >single_instance do > > reqset = load_reqset() > > if reqset.length != 0 > out="" > err="" > rc=0 > [HTTPD_PRE_CMDS, ARGV[0]].flatten.each do |cmd| > out, err, status = OpenShift::Runtime::Utils.oo_spawn("#{HTTPD_SYSTEM} #{cmd}") > if status != 0 > rc = status > break > end > end > > # Wait up to 1 minute for Apache to finish reloading. > OpenShift::Runtime::Utils.oo_spawn("/usr/bin/curl -m 60 -k https://127.0.0.1/") > > reqset.each do |fpath| > File.open(fpath,'w') { |f| > f.write( { "RC"=> rc, > "STDOUT"=> out, > "STDERR"=> err }.to_json ) > f.flush() > } > end > end > > reqfile.seek(0, IO::SEEK_SET) > res = JSON.parse(reqfile.read) > reqfile.unlink() > reqfile.close() > > if not $OPTIONS[:background] > $stderr.write(res["STDERR"]) > $stdout.write(res["STDOUT"]) > rc = res["RC"] > end >end # single_instance > >exit(rc)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1135617
: 934631