Forum: CFEngine Help
Subject: Reporting
Author: tjavo87
Link to topic: https://cfengine.com/forum/read.php?3,24824,24824#msg-24824
Hi Guys,
I created the following promise;
bundle agent sambatest
{
files:
redhat_5::
"/etc/samba/smb.conf"
comment => "samba config",
copy_from => secure_cp("$(def.anyconf)/smb.conf","$(def.policy_server)"),
classes => if_repaired("reload_sssd");
processes:
redhat_5::
"smbd"
restart_class => "start_smb";
commands:
redhat_5::
start_smb::
"/sbin/service smbd restart";
reload_sssd::
"/sbin/service smbd reload";
reports:
redhat_5::
"$(sys.date) smb service restarted"
report_to_file => "/var/cfengine/reports/$(sys.host)/smb";
It checks whether the smbd process is running or not. When the process restarts
it logs to a file.
Here comes the question;
Is it possible to log with cfengine if the process restarts successfully? With
this setup, it logs directly when the command
/sbin/service smbd restart is executed without any knowledge if the job
completed well.
Thanx!
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine