help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cfengine editfiles/RunScript problems


From: David Ressman
Subject: Cfengine editfiles/RunScript problems
Date: Mon, 23 Oct 2000 11:03:05 -0500

We're having a problem that we've noticed since at least 1.6.0a7 that's
still occurring in a13.  To define and delete printers on our solaris
machines, we're using editfiles to look for certain patterns in 
/etc/printers.conf and run the appropriate lpadmin command.  Our cfengine
input file looks like this:

   !servers::
    { /etc/printers.conf
    SetScript "/bin/lpset -a bsdaddr=oddjob,lasr132 -a lasr132 ; "
    RunScriptIfNoLineMatching "^lasr132:\\$"
    [ snip ]
    }

   !servers.!researchgroup::
    { /etc/printers.conf

    # delete queues for Flash 
    SetScript "/bin/lpset -x slate ; "
    RunScriptIfLineMatching "^slate:\\$"
    [ snip ]
    }


This was working at some point in the past (I'm not exactly sure at 
what version of cfengine this stopped working).  However, now when
we run it, those scripts just never get run.  When we look at the 
debugging output, we see this:

------------------------------------------------------------
DEFINED FILE EDITS
[snip]
 SetScript [/usr/bin/lpset -a bsdaddr=oddjob,lasr132 -a lasr132 ; ]
 RunScriptIfNoLineMatching [^lasr132:\\$]
[snip]
 SetScript [/usr/sbin/lpadmin -x slate ; ] 
 RunScriptIfLineMatching [^slate:\\$]
[snip]
---------------------------------------------------------------------
Editing files
---------------------------------------------------------------------
 Appending [lasr132:\]
 Appending [     :bsdaddr=oddjob,lasr132:\]
 Appending [     :description=Apple_LaserWriter_16/600_in_LASR_132:]
 cfengine:opus: Begin editing /etc/printers.conf
 Edit action: SetScript
 Edit action: RunScriptIfNoLineMatching
 Edit action: SetScript
 Edit action: RunScriptIfNoLineMatching
 Running command: ^lasr140:\\$ /etc/printers.conf solaris  2>&1
 cfpopen(^lasr140:\\$ /etc/printers.conf solaris  2>&1)
 cfpclose(pp)
 cfpopen - Waiting for process 7497
[snip]
 Appending [slate:\]
 Appending [     :bsdaddr=oddjob,slate:\]
 Appending [     :description=ASCI_Flash_HP_4000_in_RI_450:]
 Edit action: SetScript
 Edit action: RunScriptIfLineMatching
 Running command: ^slate:\\$ /etc/printers.conf solaris  2>&1
 cfpopen(^slate:\\$ /etc/printers.conf solaris  2>&1)
 cfpclose(pp)
 cfpopen - Waiting for process 7498


I'm not quite sure what to make of this.  Is cfengine mistakenly running
"^slate:\\$ /etc/printers.conf solaris  2>&1" as our script instead of
"/bin/lpset -x slate"?

Anyone have any ideas?

Thanks,

David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]