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 836512 Details for
Bug 1038328
/etc/cgconfig.conf ought to match production (and be closer to default)
[?]
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.
restore cgconfig to individual controller mounts
restore_cgconfig_mounts.rb (text/x-ruby), 1.58 KB, created by
Vincent Batts
on 2013-12-13 22:11:28 UTC
(
hide
)
Description:
restore cgconfig to individual controller mounts
Filename:
MIME Type:
Creator:
Vincent Batts
Created:
2013-12-13 22:11:28 UTC
Size:
1.58 KB
patch
obsolete
>#!/usr/bin/env ruby > >require 'tempfile' >require 'fileutils' > >=begin > # cpuset = /cgroup/all; > cpu = /cgroup/all; >=end >RE = /^(\s*#?\s*)(\w+)(\s*=\s*)\/cgroup\/all\s*;\s*$/ >FILE = "/etc/cgconfig.conf" > >def main(args) > in_mount = false > file_changed = false > > orig_file = File.open(args.first || FILE) > bak_filename = "#{orig_file.path}.bak.#{$$}" > FileUtils.cp(orig_file.path, bak_filename) > $stderr.puts "backed up [#{orig_file.path}] to [#{bak_filename}]" > > tmp_file = Tempfile.open("cgconfig.") > orig_file.each_line do |line| > in_mount = false if line.start_with?("}") && in_mount > if in_mount && line =~ RE > $stderr.puts "amending: #{$2}" > file_changed = true > tmp_file.puts "#{$1}#{$2}#{$3}/cgroup/#{$2};" > else > tmp_file.puts line > end > # at the end, because we still want to see this line > in_mount = true if line.start_with?("mount") > end > orig_file.close > tmp_file.flush > tmp_file.seek(0) > > unless file_changed > FileUtils.rm(bak_filename) > $stderr.puts "nothing to do" > tmp_file.close > return > end > > # Truncate before copying (since the new values aren't the same length as "all") > begin > orig_file = File.open(args.first || FILE, "w") > IO.copy_stream(tmp_file, orig_file) > $stderr.puts "compare with `diff -u #{bak_filename} #{orig_file.path}`" > $stderr.puts "INFO: changes in cgroup mounts require a reboot" > rescue => ex > $stderr.puts ex > $stderr.puts "restored #{orig_file.path}" > FileUtils.cp(bak_filename, orig_file.path) > ensure > orig_file.close > tmp_file.close > end >end > >main(ARGV)
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 1038328
:
832891
|
832892
|
836496
|
836512
|
848376