Project

General

Profile

Actions

Bug #3436

closed

Rudder always restarts cron on Ubuntu

Added by Dennis Cabooter almost 11 years ago. Updated almost 11 years ago.

Status:
Released
Priority:
2
Assignee:
Matthieu CERDA
Category:
System techniques
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

Rudder always restarts cron on Ubuntu:

 -> Making a one-time restart promise for /usr/sbin/cron
 -> Executing '/etc/init.d/cron restart' ...(timeout=-678,owner=-1,group=-1)
Q: "...nit.d/cron rest": Rather than invoking init scripts through /etc/init.d, use the service(8)
Q: "...nit.d/cron rest": utility, e.g. service cron restart
Q: "...nit.d/cron rest": Since the script you are attempting to invoke has been converted to an
Q: "...nit.d/cron rest": Upstart job, you may also use the stop(8) and then start(8) utilities,
Q: "...nit.d/cron rest": e.g. stop cron ; start cron. The restart(8) utility is also available.
Q: "...nit.d/cron rest": cron stop/waiting
Q: "...nit.d/cron rest": cron start/running, process 29958
I: Last 7 quoted lines were generated by promiser "/etc/init.d/cron restart" 
 -> Completed execution of /etc/init.d/cron restart

This happens because the process name in promises.cf is not correct on an Ubuntu system:

# ps wwwuax  | grep cron | grep -v grep
root     31539  0.0  0.0  19112   992 ?        Ss   11:28   0:00 cron

The following patch fixes this:

--- /var/rudder/cfengine-community/inputs/promises.cf.orig    2013-04-12 11:30:00.522173676 +0000
+++ /var/rudder/cfengine-community/inputs/promises.cf    2013-04-12 11:30:21.162938118 +0000
@@ -398,7 +398,7 @@

         (debian|SuSE)::

-            "cron_bin" string => "/usr/sbin/cron";
+            "cron_bin" string => "cron";
             "cron_restartcmd" string => "/etc/init.d/cron restart";

         redhat::

Related issues 2 (0 open2 closed)

Related to Rudder - Bug #3438: Technique cronManagement: the cron binary path checked in the Technique is invalidReleasedMatthieu CERDA2013-04-12Actions
Related to Rudder - Bug #3561: Cron still restarts all the timeReleasedJonathan CLARKE2013-04-29Actions
Actions #1

Updated by Dennis Cabooter almost 11 years ago

I see that the debian as well as the SuSE class is defined. Since we don't have SuSE systems, I can't test above patch with SuSE.

Actions #2

Updated by Nicolas PERRON almost 11 years ago

  • Status changed from New to 8

Dennis Cabooter wrote:

I see that the debian as well as the SuSE class is defined. Since we don't have SuSE systems, I can't test above patch with SuSE.

This is strange and seems to be Ubuntu specific:

Debian:

root@debian-7-64:~# lsb_release -c
Codename:    wheezy
root@debian-7-64:~# ps axf | grep cron
 1883 ?        Ss     0:34 /usr/sbin/cron
23577 pts/0    S+     0:00          \_ grep cron

SuSE:

sles-10-sp3-64:/opt/eclient-test2-cf/var # lsb_release -d
Description:    SUSE Linux Enterprise Server 10 (x86_64)
sles-10-sp3-64:/opt/eclient-test2-cf/var # ps axf | grep /usr/sbin/cron
24616 pts/0    S+     0:00          \_ grep /usr/sbin/cron
 2723 ?        Ss     0:00 /usr/sbin/cron

Ubuntu:

root@ubuntu-12-10-64:~# lsb_release -c
Codename:    quantal
root@ubuntu-12-10-64:~# ps axf | grep cron
17764 pts/0    S+     0:00          \_ grep --color=auto cron
  746 ?        Ss     0:17 cron

So you are right, we should change the promise. Thanks for you feed back and patch :)

Actions #3

Updated by Matthieu CERDA almost 11 years ago

  • Category set to System techniques
  • Assignee set to Matthieu CERDA
  • Priority changed from N/A to 2
  • Target version changed from 2.5.2 to 2.3.12

I'm on it.

Actions #4

Updated by Matthieu CERDA almost 11 years ago

  • Target version changed from 2.3.12 to 2.4.5

This only affects branches 2.4+

Actions #5

Updated by Matthieu CERDA almost 11 years ago

  • Status changed from 8 to In progress
  • % Done changed from 0 to 20
Actions #6

Updated by Matthieu CERDA almost 11 years ago

  • Status changed from In progress to Pending technical review
  • % Done changed from 20 to 100
  • Pull Request set to https://github.com/Normation/rudder-techniques/pull/78

PR to be reviewed.

Actions #7

Updated by Nicolas CHARLES almost 11 years ago

  • Status changed from Pending technical review to In progress

Matthieu,
Processes use unanchored regexp, so your modification is most likely too eager. Could you anchor the process name for cron ? Or use full path if possible ?

Thanks

Actions #8

Updated by Matthieu CERDA almost 11 years ago

  • Status changed from In progress to Pending technical review

PR updated

Actions #9

Updated by Matthieu CERDA almost 11 years ago

  • Status changed from Pending technical review to Pending release

Applied in changeset policy-templates:commit:1b2d74d7c69a87d3a1a8e2490428e7464c198f67.

Actions #10

Updated by Jonathan CLARKE almost 11 years ago

Applied in changeset policy-templates:commit:c3fc1a1c038de61a926e3f9075c2ac9171f1304c.

Actions #11

Updated by Nicolas PERRON almost 11 years ago

  • Status changed from Pending release to Released
Actions

Also available in: Atom PDF