Bug #3436
closedRudder always restarts cron on Ubuntu
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::
Updated by Dennis Cabooter over 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.
Updated by Nicolas PERRON over 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 :)
Updated by Matthieu CERDA over 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.
Updated by Matthieu CERDA over 11 years ago
- Target version changed from 2.3.12 to 2.4.5
This only affects branches 2.4+
Updated by Matthieu CERDA over 11 years ago
- Status changed from 8 to In progress
- % Done changed from 0 to 20
Updated by Matthieu CERDA over 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.
Updated by Nicolas CHARLES over 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
Updated by Matthieu CERDA over 11 years ago
- Status changed from In progress to Pending technical review
PR updated
Updated by Matthieu CERDA over 11 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset policy-templates:commit:1b2d74d7c69a87d3a1a8e2490428e7464c198f67.
Updated by Jonathan CLARKE over 11 years ago
Applied in changeset policy-templates:commit:c3fc1a1c038de61a926e3f9075c2ac9171f1304c.
Updated by Nicolas PERRON over 11 years ago
- Status changed from Pending release to Released