Changeset 404 for branches


Ignore:
Timestamp:
07/26/2009 16:07:17 (3 years ago)
Author:
blee
Message:

Merging from trunk confsync and confaudit delay capabilities.

See #55

Location:
branches/confman-1.9
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/confman-1.9

  • branches/confman-1.9/confaudit.8

    r351 r404  
    3434.Nm 
    3535.Op Fl q 
     36.Op Fl s 
    3637.Nm 
    3738.Fl h 
     
    5657to display the usage statement and exit. 
    5758.Pp 
     59The 
     60.Fl s 
     61option will cause 
     62.Nm 
     63to run in sleep mode.  In this mode, 
     64.Nm 
     65will sleep for CONF_AUDIT_SLEEP seconds before executing.  This can be used to 
     66stagger the execution of 
     67.Nm 
     68across multiple managed hosts. 
     69.Pp 
    5870.Nm 
    5971uses the export file that is generated by  
  • branches/confman-1.9/confaudit.in

    r400 r404  
    4040 
    4141quiet=false 
    42 while getopts "dqh" opt 2>&4 ; do 
     42sleep_mode=false 
     43while getopts "dqsh" opt 2>&4 ; do 
    4344    case $opt in  
    4445        d) DEBUG=true ;; 
    4546        q) quiet=true ;; 
     47        s) sleep_mode=true ;; 
    4648        h) print_help 0 ;; 
    4749        *) print_help 1 ;; 
     
    5961 
    6062conf_lock_system 
     63 
     64if $sleep_mode; then 
     65    if [ -n "${CONF_AUDIT_SLEEP}" ] && [ ${CONF_AUDIT_SLEEP} -ge 0 ]; then 
     66        echo "Sleeping ${CONF_AUDIT_SLEEP} seconds..." 
     67        sleep ${CONF_AUDIT_SLEEP} 
     68    else 
     69        echo "Invalid sleep value: ${CONF_AUDIT_SLEEP}" >&2 
     70        exit 1 
     71    fi 
     72fi 
    6173 
    6274# Set up our "Working Copy" 
  • branches/confman-1.9/confman.conf.5.in

    r385 r404  
    104104client for 
    105105.Cm confsync . 
     106.It CONF_SYNC_SLEEP 
     107The number of seconds for 
     108.Xr confsync 8 
     109to sleep when running in sleep mode. 
     110.It CONF_AUDIT_SLEEP 
     111The number of seconds for 
     112.Xr confaudit 8 
     113to sleep when running in sleep mode. 
    106114.It CONF_SSH_KEY 
    107115This option is deprecated and will be removed in a future release. See  
  • branches/confman-1.9/confman.conf.in

    r363 r404  
    7373CONF_SSH_KEY="/root/.ssh/id_rsa" 
    7474 
     75# confsync sleep (in seconds) 
     76CONF_SYNC_SLEEP="" 
     77 
     78# confaudit sleep (in seconds) 
     79CONF_AUDIT_SLEEP="" 
     80 
    7581# Enable or disable debugging 
    7682DEBUG="false" 
  • branches/confman-1.9/confsync.8

    r332 r404  
    3333.Sh SYNOPSIS 
    3434.Nm 
     35.Op Fl s 
    3536.Nm 
    3637.Fl h 
     
    4546.Cm confman commit 
    4647operation without the overhead of a working copy. 
     48.Pp 
     49The 
     50.Fl s 
     51option will cause 
     52.Nm 
     53to run in sleep mode.  In this mode, 
     54.Nm 
     55will sleep for CONF_SYNC_SLEEP seconds before executing.  This can be used to 
     56stagger the execution of 
     57.Nm 
     58across multiple managed hosts. 
    4759.Pp 
    4860When launched with 
  • branches/confman-1.9/confsync.in

    r400 r404  
    4242} 
    4343 
    44 while getopts "hd" OPT 2>&4 ; do 
     44sleep_mode=false 
     45while getopts "hsd" OPT 2>&4 ; do 
    4546    case $OPT in 
    4647        d)  DEBUG=true ;; 
     48        s)  sleep_mode=true ;; 
    4749        h)  print_help 0;; 
    4850        *)  print_help 1;; 
     
    6062 
    6163conf_lock_system 
     64 
     65if $sleep_mode; then 
     66    if [ -n "${CONF_SYNC_SLEEP}" ] && [ ${CONF_SYNC_SLEEP} -ge 0 ]; then 
     67        echo "Sleeping ${CONF_SYNC_SLEEP} seconds..." 
     68        sleep ${CONF_SYNC_SLEEP} 
     69    else 
     70        echo "Invalid sleep value: ${CONF_SYNC_SLEEP}" >&2 
     71        exit 1 
     72    fi 
     73fi 
    6274 
    6375# Set up our "Working Copy" 
Note: See TracChangeset for help on using the changeset viewer.