Issue #709 has been updated by micah.
Category set to cron
Status changed from Closed to Re-opened
Affected version set to 0.24.7
This is an ancient bug, but I am seeing it now. Every run I get this message:
<pre>
Jan 2 06:22:30 spamd2 puppetd[30676]:
(//Node[spamd2]/spamd/Cron[sa-update_openprotect]/environment) environment
changed 'TMPDIR=/var/tmp,TMP=/var/tmp' to 'TMPDIR=/var/tmp TMP=/var/tmp'
</pre>
Although the crontab itself doesn't show that the environment is set that way:
<pre>
# HEADER: This file was autogenerated at Fri Jan 02 09:00:02 -0800 2009 by
puppet.
# HEADER: While it can still be managed manually, it is definitely not
recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
# m h dom mon dow command
# Puppet Name: sa-update_openprotect
TMPDIR=/var/tmp
TMP=/var/tmp
0 2 * * * sa-update --gpgkeyfile /etc/spamassassin/sa-update_gpgkeys
--channelfile /etc/spamassassin/sa-update_channels && sa-compile &>/dev/null &&
/etc/init.d/spamassassin restart &>/dev/null
# Puppet Name: bayes_expire
0 3 * * * sa-learn --sync --force-expire >/dev/null 2>&1
# Puppet Name: spamassassin_munin
*/5 * * * * /usr/local/bin/spamassasin_munin
# Puppet Name: update_root_hints
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
0 3 27 * * /usr/local/sbin/roothints_update.sh
</pre>
The actual puppet snippet is:
<pre>
cron {
"sa-update_openprotect":
command => "sa-update --gpgkeyfile /etc/spamassassin/sa-update_gpgkeys
--channelfile /etc/spamassassin/sa-update_channels && sa-compile &>/dev/null &&
/etc/init.d/spamassassin restart &>/dev/null",
environment => "TMPDIR=/var/tmp\nTMP=/var/tmp",
user => root,
hour => 2,
minute => 0;
# Because we are turning auto_expire off in the spamassassin local.cf, we
need to do it here, see comments in local.cf as to why we are doing this
"bayes_expire":
command => "sa-learn --sync --force-expire >/dev/null 2>&1",
user => root,
hour => 3,
minute => 0;
"spamassassin_munin":
command => "/usr/local/bin/spamassasin_munin",
user => root,
minute => '*/5';
}
</pre>
This particular error is coming about because I first setup this cron line
incorrectly, and then changed it:
<pre>
@@ -57,7 +57,7 @@ class spamd {
cron {
"sa-update_openprotect":
command => "sa-update --gpgkeyfile /etc/spamassassin/sa-update_gpgkeys
--channelfile /etc/spamassassin/sa-update_channels && sa-compile &>/dev/null &&
/etc/init.d/spamassassin restart &>/dev/null",
- environment => '["TMPDIR=/var/tmp", "TMP=/var/tmp"]',
+ environment => "TMPDIR=/var/tmp\nTMP=/var/tmp",
user => root,
hour => 2,
minute => 0;
</pre>
The replaced line was incorrect, which generated other errors of course, but
this particular error started happening after I fixed it with what is shown
above.
----------------------------------------
Bug #709: crontab type seems to detect the current environment lines wrong
http://projects.reductivelabs.com/issues/show/709
Author: BarnacleBob
Status: Re-opened
Priority: Normal
Assigned to: luke
Category: cron
Target version:
Complexity: Unknown
Patch: None
Affected version: 0.24.7
Keywords:
<pre>
notice:
//node1/baseserverrole/webserverrole/webcron/rcron[ntpd_check]/Cron[ntpd_check]/environment:
environment changed
'[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]'
to '[email protected]'
</pre>
The cron provider seems to think there are more MAILTO's then actually are. As
listing the crontab shows:
<pre>
# Puppet Name: ntpd_check
[email protected]
*/5 * * * * /root/bin/ntpmon > /dev/null 2>&1
</pre>
This happens everytime puppetd --test is run.
puppet config:
<pre>
rCron{ ntpd_check:
command=>"/root/bin/ntpmon > /dev/null 2>&1",
minute=>"*/5",
require=>RFile[[rootbinntpmon]]
}
define
rCron($command,$minute=absent,$hour=absent,$monthday=absent,$month=absent,$weekday=absent,$environment="[email protected]"){
cron{ $name:
command=>$command,
minute=>$minute,
hour=>$hour,
month=>$month,
monthday=>$monthday,
weekday=>$weekday,
environment=>$environment,
user=>root
}
}
</pre>
----------------------------------------
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://reductivelabs.com/redmine/my/account
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---