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 935170 Details for
Bug 844607
aiccu treats lack of network connectivity on startup as a fatal error
[?]
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.
startup script for aiccu waiting for chrony sync
start_aiccu_after_chrony.rb (text/plain), 2.58 KB, created by
Frank Ansari
on 2014-09-07 15:55:11 UTC
(
hide
)
Description:
startup script for aiccu waiting for chrony sync
Filename:
MIME Type:
Creator:
Frank Ansari
Created:
2014-09-07 15:55:11 UTC
Size:
2.58 KB
patch
obsolete
>#!/usr/bin/ruby ># -------------------------------------------------------------------------- ># File : start_aiccu_after_chrony.rb ># Date : 2012-11-30 ># Author : Frank Ansari ># Purpose : start aiccu but wait for time synchronization ># -------------------------------------------------------------------------- > >require 'logger' > ># -------------------------------------------------------------------------- >class StartAiccuAfterChrony > def initialize > @sleep = 2 > @tries = 10 > @chrony_pid_file = '/var/run/chronyd.pid' > @log = Logger.new('/var/log/scripts/start_aiccu_after_chrony.log') > end > > def check_chrony > # return values: > # 0: OK > # 1: daemon is running but no synchronization > # 2: dameon is not running > s = system('systemctl status chronyd.service > /dev/null 2>&1') > r = 2 > if s > IO.popen('chronyc tracking') do |p| > p.each do |line| > if line.match('Leap status') > if line.match('Normal') > r = 0 > else > r = 1 > end > end > end > end > else > # chronyd is not running > r = 2 > end > return r > end > > def wait_for_chrony > start = false > n = 0 > while n < @tries and !start do > c = check_chrony > if c == 0 > @log.info('chrony available') > start = true > elsif c == 1 > @log.info('chrony synchronizing') > else > @log.info('chrony is not started yet') > end > if start > break > else > sleep @sleep > end > n += 1 > end > return start > end > > def start_chrony > if File.exists?(@chrony_pid_file) > rm_cmd = 'rm -f ' + @chrony_pid_file > @log.info(rm_cmd) > system(rm_cmd) > end > @log.info('starting chrony') > system('systemctl start chronyd.service > /dev/null 2>&1') > end > > def start_aiccu > start = false > @log.info('--- starting ---') > as = system('systemctl status aiccu.service > /dev/null 2>&1') > if as == 0 > @log.info('aiccu is already started') > else > start = wait_for_chrony > if start > @log.info('starting aiccu') > system('/usr/sbin/aiccu start > /dev/null 2>&1') > else > start_chrony > start = wait_for_chrony > if start > @log.info('starting aiccu') > system('/usr/sbin/aiccu start > /dev/null 2>&1') > else > @log.info('cannot start chrony') > end > end > end > @log.info('--- finished ---') > end >end ># -------------------------------------------------------------------------- > >startAiccu = StartAiccuAfterChrony.new > >startAiccu.start_aiccu
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 844607
:
602614
|
602615
|
602791
|
602794
|
603220
|
713303
|
714220
| 935170