Hi all,

I'm writing a promise to keep a nameserver and a locking daemon for a
CAD package running as a specific user, and on one RHEL3 64 bit machine
(yes I know, no longer supported by Red Hat, but we need it for legacy
designs) I get the following errors:

Validation: Error reading assumed integer value "Ja" => "-678" (found remainder 
"")
Validation: Error reading assumed integer value "" => "-678" (found remainder 
"")
Validation: Error reading assumed integer value "Ja" => "-678" (found remainder 
"")
Validation: Error reading assumed integer value "" => "-678" (found remainder 
"")
Validation: Error reading assumed integer value "Ja" => "-678" (found remainder 
"")
Validation: Error reading assumed integer value "" => "-678" (found remainder 
"")

However, the same promise runs just fine on RHEL4 and 5 machines.

The idea behind the promise is that the nameserver and the locking daemon
should be running as user "support". When they are running as another user,
they should be killed. Here is the code:

bundle agent cadpackage
{
vars:
  "cadpackage_path" string => "/opt/cadpackage/tools/bin" ;

  "nameserver" string => "NameServer";
  "lockd" string => "LockDaemon";
  "runas" string => "support";

processes:
 cadserv1|cadserv2|cadserv3::
 "$(nameserver)"
        comment         => "Make sure there is no Cadpackage nameserver running 
as another user",
        process_select  => find_not_cadpackage_process("$(runas)"),
        signals         => { "term", "kill"  },
        action          => cadpackage_check;

 "$(nameserver)"
        comment         => "Make sure Cadpackage nameserver is running",
        process_select  => find_cadpackage_process("$(runas)"),
        restart_class   => "restart_nameserver",
        action          => cadpackage_check;


 "$(lockd)"
        comment         => "Make sure there is no Cadpackage locking daemon 
running as another user",
        process_select  => find_not_cadpackage_process("$(runas)"),
        signals         => { "term", "kill"  },
        action          => cadpackage_check;

 "$(lockd)"
        comment         => "Make sure Cadpackage locking daemon is running",
        process_select  => find_cadpackage_process("$(runas)"),
        restart_class   => "restart_lockd",
        action          => cadpackage_check;

commands:
 restart_nameserver::
        "/bin/su $(runas) '$(cadpackage_path)/$(nameserver)'";

 restart_lockd::
        "$(cadpackage_path)/$(lockd) -setuid $(runas)";

reports:
 restart_nameserver::
        "Restarted Cadpackage nameserver";

 restart_lockd::
        "Restarted Cadpackage locking daemon";
}


body action cadpackage_check
{
        ifelapsed       => "1";
}


body process_select find_cadpackage_process(owner)
{
        process_owner   => { "$(owner)" };
        process_result  => "process_owner";
}


body process_select find_not_cadpackage_process(owner)
{
        process_owner   => { "$(owner)" };
        process_result  => "!process_owner";
}


I don't think there is something obviously wrong in my code because
otherwise cfengine would have told me exactly which line would contain
the error, but maybe there is something subtle I'm missing?


Regards,

Erik

-- 
Erik Mouw -- erik.m...@snow.nl
Snow B.V. -- http://snow.nl/

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to