On Wed, Aug 06, 2008 at 10:33:01PM +0200, Michal Svec wrote:
> Can't we get this information from SCR, without calling explicitely some  
> functions (which is going to be error prone)?
>
> For instance the example above could be generated from SCR (layer), one  
> would (more or less :) only need .path -> file/function translation to  
> create such a log.

SCR could do it if that was a reuqirement from early on, but I am
afraid that it is not quite suited for this use at this point. In
other words, it would be rather "much more" than "less" I think.

Anyway, we can see how that would look like from watching what goes
through SCR:
Y2DEBUG=1 (or [Debug] scr=true in log.conf), then
egrep -A3 'executeSubagentCommand: (Write|Execute)' y2log

For example attached is one such log, which I would like to see
described as
  Note "changed ntp server from ntp.suse.cz to random one from pool.ntp.org"
  Item "/etc/ntp/conf: server list changed to 0.pool.ntp.org 1.pool.ntp.org 
2.pool.ntp.org"
  Item "/etc/sysconfig/ntp: NTPD_RUN_CHROOTED changed to yes" (hmm, that's a 
gratuitous change)
  Item "restarted /etc/init.d/ntp"

I encourage people to try this with their own modules and perhaps
post the results so that we get a better idea if pursuing this path
is worthwhile.

-- 
Martin Vidner, YaST developer
http://en.opensuse.org/User:Mvidner

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
2008-08-07 14:48:20 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Execute
2008-08-07 14:48:20 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: .target.bash_output
2008-08-07 14:48:20 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: "locale -k charmap"
2008-08-07 14:48:20 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: null
--
2008-08-07 14:48:22 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Execute
2008-08-07 14:48:22 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: .target.bash_output
2008-08-07 14:48:22 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: "/usr/bin/id --user"
2008-08-07 14:48:22 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: null
--
2008-08-07 14:48:22 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Execute
2008-08-07 14:48:22 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: .target.bash
2008-08-07 14:48:22 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: "rpm -q --whatprovides ntp"
2008-08-07 14:48:22 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: null
--
2008-08-07 14:48:23 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Execute
2008-08-07 14:48:23 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: .target.bash_output
2008-08-07 14:48:23 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: "/usr/bin/md5sum 
/etc/ntp.conf"
2008-08-07 14:48:23 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: null
--
2008-08-07 14:48:23 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Execute
2008-08-07 14:48:23 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: .target.bash
2008-08-07 14:48:23 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: "rpm -q --whatprovides 
SuSEfirewall2"
2008-08-07 14:48:23 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: null
--
2008-08-07 14:48:24 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Execute
2008-08-07 14:48:24 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: .target.bash
2008-08-07 14:48:24 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: 
"/etc/init.d/SuSEfirewall2_init status"
2008-08-07 14:48:24 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: $["TERM":"raw"]
--
2008-08-07 14:48:24 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Execute
2008-08-07 14:48:24 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: .target.bash
2008-08-07 14:48:24 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: 
"/etc/init.d/SuSEfirewall2_setup status"
2008-08-07 14:48:24 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: $["TERM":"raw"]
--
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Write
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: .etc.ntp_conf.all
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: $["comment":"", "file":-1, 
"kind":"section", "name":"", "type":-1, 
"value":[$["comment":"################################################################################\n##
 /etc/ntp.conf\n##\n## Sample NTP configuration file.\n## See package 'ntp-doc' 
for documentation, Mini-HOWTO and FAQ.\n## Copyright (c) 1998 S.u.S.E. GmbH 
Fuerth, Germany.\n##\n## Author: Michael Andres,  <[EMAIL PROTECTED]>\n##       
  Michael Skibbe,  <[EMAIL 
PROTECTED]>\n##\n################################################################################\n\n##\n##
 Radio and modem clocks by convention have addresses in the \n## form 
127.127.t.u, where t is the clock type and u is a unit \n## number in the range 
0-3. \n##\n## Most of these clocks require support in the form of a \n## serial 
port or special bus peripheral. The particular  \n## device is normally 
specified by adding a soft link \n## /dev/device-u to the particular hardware 
device involved, \n## where u correspond to the unit number above. \n## \n## 
Generic DCF77 clock on serial port (Conrad DCF77)\n## Address:     
127.127.8.u\n## Serial Port: /dev/refclock-u\n##  \n## (create soft link 
/dev/refclock-0 to the particular ttyS?)\n##\n# server 127.127.8.0 mode 5 
prefer\n\n##\n## Undisciplined Local Clock. This is a fake driver intended for 
backup\n## and when no outside source of synchronized time is 
available.\n##\n", "kind":"value", "name":"server", "type":0, 
"value":"127.127.1.0 "], $["comment":"# local clock (LCL)\n", "kind":"value", 
"name":"fudge", "type":0, "value":"127.127.1.0  stratum 10"], $["comment":"# 
LCL is unsynchronized\n\n##\n## Add external Servers using\n## # rcntp 
addserver <yourserver>\n## \n\n##\n## Miscellaneous stuff\n##\n\n", 
"kind":"value", "name":"driftfile", "type":0, 
"value":"/var/lib/ntp/drift/ntp.drift          "], $["comment":"# path for 
drift file\n\n", "kind":"value", "name":"logfile", "type":0, 
"value":"/var/log/ntp\t\t         "], $["comment":"# alternate log file\n# 
logconfig =syncstatus + sysevents\n# logconfig =all\n\n# statsdir /tmp/\t\t# 
directory for statistics files\n# filegen peerstats  file peerstats  type day 
enable\n# filegen loopstats  file loopstats  type day enable\n# filegen 
clockstats file clockstats type day enable\n\n#\n# Authentication stuff\n#\n", 
"kind":"value", "name":"keys", "type":0, "value":"/etc/ntp.keys\t\t         "], 
$["comment":"# path for keys file\n", "kind":"value", "name":"trustedkey", 
"type":0, "value":"1\t\t\t         "], $["comment":"# define trusted keys\n", 
"kind":"value", "name":"requestkey", "type":0, "value":"1\t\t\t         "], 
$["comment":"", "kind":"value", "name":"ntp.suse.cz", "type":0, "value":" "], 
$["comment":"\n# Random pool server, see http://www.pool.ntp.org/ for more 
information\n", "kind":"value", "name":"server", "type":0, 
"value":"0.pool.ntp.org "], $["comment":"\n# Random pool server, see 
http://www.pool.ntp.org/ for more information\n", "kind":"value", 
"name":"server", "type":0, "value":"1.pool.ntp.org "], $["comment":"\n# Random 
pool server, see http://www.pool.ntp.org/ for more information\n", 
"kind":"value", "name":"server", "type":0, "value":"2.pool.ntp.org "]]]
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: null
--
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Write
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: .etc.ntp_conf
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: nil
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: null
--
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Execute
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: .target.bash_output
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: "/usr/bin/md5sum 
/etc/ntp.conf"
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: null
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Write
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: .target.ycp
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: 
"/var/lib/YaST2/file_checksums.ycp"
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: 
$["/etc/ntp.conf":"c1e5e61adf20b50edda892efe8404190  /etc/ntp.conf\n"]
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Write
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: 
.sysconfig.ntp.NTPD_RUN_CHROOTED
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: "yes"
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: null
--
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Write
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: .sysconfig.ntp
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: nil
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: null
--
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):573 
ScriptingAgent::executeSubagentCommand: Execute
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):574 path: .target.bash
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):575 arg: "/etc/init.d/ntp restart"
2008-08-07 14:48:36 <0> linux-nrqz(2472) [scr] 
ScriptingAgent.cc(executeSubagentCommand):576 opt: $["TERM":"raw"]

Reply via email to