Project

General

Profile

Actions

Bug #6566

closed

Bug #6737: Make all techniques compatible with systemd changes

promises.cf's "bundle agent check_cron_daemon" is not systemd aware

Added by Janos Mattyasovszky over 9 years ago. Updated over 9 years ago.

Status:
Released
Priority:
N/A
Assignee:
Matthieu CERDA
Category:
System integration
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

OS: SLES12 GA
Agent: rudder-agent-3.1.0.alpha1.git201505060128-1.SLES.12.x86_64
Root: rudder-server-root-3.0.4.release-1.SLES.11

rudder agent run shows these errors:

2015-05-06T13:27:42+0200    error: /default/check_cron_daemon/commands/'/etc/init.d/cron restart'[0]: Proposed executable file '/etc/init.d/cron' doesn't exist
2015-05-06T13:27:42+0200    error: /default/check_cron_daemon/commands/'/etc/init.d/cron restart'[0]: '/etc/init.d/cron restart' promises to be executable but isn't
R: @@Common@@result_error@@hasPolicyServer-root@@common-root@@00@@CRON Daemon@@None@@2015-05-06 11:27:41+00:00##bcd71b67-8a11-4426-85f9-f1056870fb32@#The CRON daemon was not running and could not be restarted

The actually false-positive error comes from the process not matching the regex in the promises: "/usr/sbin/cron$"

On SLES12 this actually looks like this:

sles12:/var/rudder/cfengine-community/inputs # ps auxfwww | grep cron
root      94992  0.0  0.0   9236   936 pts/3    S+   13:29   0:00                      \_ grep --color=auto cron
root      14867  0.0  0.0  18848  1544 ?        Ss   Feb23   0:02 /usr/sbin/cron -n

The promises.cf in use also does not know how to restart the cron daemon, as it still tries to use the init.d script:

sles12:/var/rudder/cfengine-community/inputs # grep -n /etc/init.d/ promises.cf  -C4
374-  vars:
375-
376-    redhat::
377-      "cron_bin" string => "crond$";
378:      "cron_restartcmd" string => "/etc/init.d/crond restart";
379-
380-    ubuntu::
381-      "cron_bin" string => "cron$";
382:      "cron_restartcmd" string => "/etc/init.d/cron restart";
383-
384-    !(redhat|ubuntu)::
385-      "cron_bin" string => "/usr/sbin/cron$";
386:      "cron_restartcmd" string => "/etc/init.d/cron restart";
387-
388-  processes:
389-
390-    !android.!windows::

But that init script is missing on SLES12 (systemd):

sles12:/var/rudder/cfengine-community/inputs # ll "/etc/init.d/cron" 
ls: cannot access /etc/init.d/cron: No such file or directory

Related issues 2 (0 open2 closed)

Related to Rudder - Bug #4155: Commands to check and restart cron daemon on Fedora are not correctReleasedMatthieu CERDA2013-11-15Actions
Related to Rudder - Bug #7518: Promise types out of order in initial promises' promises.cfReleasedBenoît PECCATTE2015-11-30Actions
Actions

Also available in: Atom PDF