[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shell command classes don't work?
From: |
Christian Pearce |
Subject: |
Re: shell command classes don't work? |
Date: |
Wed, 05 May 2004 10:04:51 -0400 |
Correct me if I am wrong, but the class is defined if the command was
successful. Clearly the last command you executed failed.
[pearcec@krusty pearcec]$ echo test | grep testt
[pearcec@krusty pearcec]$ echo $?
1
On Wed, 2004-05-05 at 03:41, Kai Grossjohann wrote:
> I've got the following file /home/kgrossjo/tmp/cfagent.conf:
>
> control:
> actionsequence = ( shellcommands )
>
> classes:
> x = ( '/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE"' )
>
> shellcommands:
> x::
> "/bin/echo yes"
>
> Below, you can find the output that's generated. Why does this fail
> to define the class x?
>
> This is using the cfengine2 package from Debian unstable.
>
> Kai
>
>
> Reference time set to Wed May 5 09:39:10 2004
>
> Job start time set to Wed May 5 09:39:10 2004
>
> GNU Configuration Engine -
> 2.1.0b5
> Free Software Foundation 1994-
> Donated by Mark Burgess, Faculty of Engineering,
> Oslo University College, 0254 Oslo, Norway
>
> ------------------------------------------------------------------------
>
> Host name is: rumba
> Operating System Type is linux
> Operating System Release is 2.4.25-2-kgrossjo
> Architecture = i686
>
>
> Using internal soft-class linux for host linux
>
> The time is now Wed May 5 09:39:10 2004
>
>
> ------------------------------------------------------------------------
>
> Additional hard class defined as: 32_bit
> Additional hard class defined as: linux_2_4_25_2_kgrossjo
> Additional hard class defined as: linux_i686
> Additional hard class defined as: linux_i686_2_4_25_2_kgrossjo
> Additional hard class defined as:
> linux_i686_2_4_25_2_kgrossjo__1_Thu_Apr_29_12_38_10_CEST_2004
>
> GNU autoconf class from compile time: compiled_on_linux-gnu
>
> Address given by nameserver: 127.0.0.1
> Interface 1: lo
> Interface 2: eth0
> Interface 3: vmnet8
> Interface 4: vmnet1
> Sorry - there is no current standard way to find out my IPv6 address (!!)
>
> Unable to detect environment from cfenvd
>
> cfengine:: No preconfiguration file
>
> $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
> * (Changing context state to: main) *
> $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
>
> ---------------------------------------------------------------------
> Loading persistent classes
> ---------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> Loaded persistent memory
> ---------------------------------------------------------------------
>
>
> Unable to detect environment from cfenvd
>
> Looking for an input file /home/kgrossjo/tmp/cfagent.conf
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": /usr/bin/lspci:
> invalid option -- q
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": Usage: lspci
> [<switches>]
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -v
> Be verbose
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -n
> Show numeric ID's
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -b
> Bus-centric view (PCI addresses and IRQ's instead of those seen by the CPU)
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -x
> Show hex-dump of the standard portion of config space
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -xxx
> Show hex-dump of the whole config space (dangerous; root only)
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -s
> [[<bus>]:][<slot>][.[<func>]] Show only devices in selected slots
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -d
> [<vendor>]:[<device>] Show only selected devices
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -t
> Show bus tree
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -m
> Produce machine-readable output
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -i <file>
> Use specified ID database instead of /usr/share/misc/pci.ids
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -M
> Enable `bus mapping' mode (dangerous; root only)
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -P <dir> Use
> specified directory instead of /proc/bus/pci
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -H <mode>
> Use direct hardware access (<mode> = 1 or 2)
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -F <file>
> Read configuration data from given file
> cfengine::/usr/bin/lspci | /bin/grep -q "Intel.*PRO/100 VE": -G
> Enable PCI access debugging
> Finished with cfagent.conf
> Accepted domain name: undefined.domain
>
>
> Defined Classes = ( any cfengine_2_1_0b5 debian Wednesday Hr09 Min39 Min35_40
> Q3 Hr09_Q3 Day5 May Yr2004 linux rumba 32_bit linux_2_4_25_2_kgrossjo i686
> linux_i686 linux_i686_2_4_25_2_kgrossjo
> linux_i686_2_4_25_2_kgrossjo__1_Thu_Apr_29_12_38_10_CEST_2004
> compiled_on_linux_gnu localhost rumba_de_uu_net net_iface_lo net_iface_eth0
> 139_4_37_213 dhcp_213_de_uu_net 139_4_37 ipv4_139_4_37_213 ipv4_139_4_37
> ipv4_139_4 ipv4_139 net_iface_vmnet8 net_iface_vmnet1 )
>
> Negated Classes = ( )
>
> Installable classes = ( )
>
> Global expiry time for locks: 120 minutes
>
> Global anti-spam elapse time: 1 minutes
>
> Extensions which should not be directories = ( )
> Suspicious filenames to be warned about = ( )
> LogDirectory = /home/kgrossjo/.cfagent
> cfengine:rumba: Couldn't find a private key
> (/home/kgrossjo/.cfagent/ppkeys/localhost.priv) - use cfkey to get one
> cfengine:rumba: open: No such file or directory
>
> Checksum database is /var/lib/cfengine2/checksum.db
> Reference time set to Wed May 5 09:39:10 2004
>
> Job start time set to Wed May 5 09:39:10 2004
>
>
> *********************************************************************
> Main Tree Sched: shellcommands pass 1 @ Wed May 5 09:39:10 2004
> *********************************************************************
>
> Job start time set to Wed May 5 09:39:10 2004
>
> ---------------------------------------------------------------------
> Alerts
> ---------------------------------------------------------------------
>
>
>
> ++++++++++++++++++++++++++++++++++++++++
> Summary of objects involved
> ++++++++++++++++++++++++++++++++++++++++
>
> global
> main
>
>
>
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine
--
Christian Pearce
http://www.commnav.com
http://www.perfectorder.com