Issue #3722 has been updated by Stefan Schulte.
having a second look at the `read` method of the suntab filetype
<pre>
def read
output = Puppet::Util.execute(%w{crontab -l}, :uid => @path)
return "" if output.include?("can't open your crontab")
raise Puppet::Error, "User #{@path} not authorized to use cron" if
output.include?("you are not authorized to use cron")
return output
rescue => detail
raise Puppet::Error, "Could not read crontab for #{@path}: #{detail}"
end
</pre>
the check against "you are not authorized to use cron" will always be false if
the cron executable prints this message on stderr instead of stdout (I don't
have a solaris to verify that). The problem here is that `:uid => @path` is
passed as an argument hash, overwriting the default `:combine => true` so
stderr will be discarded.
If my assumption is correct #14283 will fix this issue as well.
----------------------------------------
Bug #3722: cron issue on Solaris when user is not allowed to use cron
https://projects.puppetlabs.com/issues/3722#change-66944
Author: Mark Plaksin
Status: Accepted
Priority: Normal
Assignee:
Category: cron
Target version:
Affected Puppet version: 0.25.4
Keywords: cron solaris
Branch:
This is related to but maybe not the same as #3721. Puppet thinks it
successfully created a cron job but it really failed. On Solaris with this in
'pp':
<pre>
cron {testcron:
hour => 7,
minute => 0,
command => "echo hi",
ensure => present,
user => happy,
}
</pre>
I get this:
<pre>
# puppet --debug --trace --verbose pp
debug: Failed to load library 'selinux' for feature 'selinux'
debug: Creating default schedules
debug: Failed to load library 'shadow' for feature 'libshadow'
debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl does
not exist
debug: Puppet::Type::User::ProviderPw: file pw does not exist
debug: Puppet::Type::User::ProviderHpuxuseradd: file /usr/sam/lbin/usermod.sam
does not exist
debug: Failed to load library 'ldap' for feature 'ldap'
debug: Puppet::Type::User::ProviderLdap: feature ldap is missing
debug: /File[/var/puppet/state/state.yaml]: Autorequiring
File[/var/puppet/state]
debug: /File[/etc/puppet/ssl/certificate_requests]: Autorequiring
File[/etc/puppet/ssl]
debug: /File[/etc/puppet/ssl/certs/elvis.view.usg.edu.pem]: Autorequiring
File[/etc/puppet/ssl/certs]
debug: /File[/var/puppet/log]: Autorequiring File[/var/puppet]
debug: /File[/var/puppet/state]: Autorequiring File[/var/puppet]
debug: /File[/etc/puppet/ssl/private]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/puppet/lib]: Autorequiring File[/var/puppet]
debug: /File[/etc/puppet/ssl/crl.pem]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/puppet/run]: Autorequiring File[/var/puppet]
debug: /File[/etc/puppet/ssl/certs/ca.pem]: Autorequiring
File[/etc/puppet/ssl/certs]
debug: /File[/etc/puppet/ssl/certs]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/etc/puppet/ssl/public_keys]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/etc/puppet/ssl/private_keys/elvis.view.usg.edu.pem]:
Autorequiring File[/etc/puppet/ssl/priva
te_keys]
debug: /File[/var/puppet/clientbucket]: Autorequiring File[/var/puppet]
debug: /File[/var/puppet/state/graphs]: Autorequiring File[/var/puppet/state]
debug: /File[/etc/puppet/ssl/private_keys]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/puppet/client_yaml]: Autorequiring File[/var/puppet]
debug: /File[/var/puppet/state/classes.txt]: Autorequiring
File[/var/puppet/state]
debug: /File[/var/puppet/facts]: Autorequiring File[/var/puppet]
debug: /File[/etc/puppet/ssl]: Autorequiring File[/etc/puppet]
debug: Finishing transaction 8495796 with 0 changes
debug: Prefetching crontab resources for cron
debug: Executing 'crontab -l'
info: Applying configuration version '1273006853'
debug: //Cron[testcron]: Changing ensure
debug: //Cron[testcron]: 1 change(s)
notice: //Cron[testcron]/ensure: created
debug: Flushing cron provider target happy
# HEADER: This file was autogenerated at Tue May 04 17:00:53 -0400 2010 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.
# Puppet Name: testcron
0 7 * * * echo hi
debug: Executing 'crontab /tmp/puppet.14415.0'
debug: Finishing transaction 8320356 with 1 changes
</pre>
But no crontab entry is created. If I run @crontab -e happy@ or @crontab -l
happy@ as root I get this:
<pre>
crontab: you are not authorized to use cron. Sorry.
</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://projects.puppetlabs.com/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.