Bug #3722

cron issue on Solaris when user is not allowed to use cron

Added by Mark Plaksin almost 2 years ago. Updated 27 days ago.

Status:Accepted Start date:05/04/2010
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:cron
Target version:-
Affected Puppet version:0.25.4 Branch:
Keywords:cron solaris
Votes: 2

Description

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’:

    cron {testcron:
        hour => 7,
        minute => 0,
        command => "echo hi",
        ensure => present,
        user => happy,
    }

I get this:

# 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

But no crontab entry is created. If I run @crontab -e happy@ or @crontab -l happy@ as root I get this:

    crontab: you are not authorized to use cron.  Sorry.

History

Updated by James Turnbull almost 2 years ago

  • Category set to cron
  • Status changed from Unreviewed to Accepted
  • Assignee set to Jesse Wolfe

Updated by Rudy Gevaert over 1 year ago

I don’t have any problem with this on 2.6.2.

However I found that out when submitting a time entry format that cron on solaris doesn’t accept (*/5) you don’t get informed about that. It tries to setup that cron file but it doesn’t see that updating the cron failed.

Updated by Nigel Kersten 10 months ago

  • Status changed from Accepted to Closed

Rudy, can you file a separate bug for that please?

From reading your report it looks like 2.6.x has resolved this. Please reopen if this is not the case.

Updated by Rudy Gevaert 10 months ago

  • Status changed from Closed to Re-opened

Hi Nigel,

I can say that the bug still exists. (I don’t have any 2.6.2 anymore.):

root@zonnevis:/# cat test.pp 
 cron {testcron:
        hour => 7,
        minute => 0,
        command => "echo hi",
        ensure => present,
        user => nobody,
    }

root@zonnevis:/# puppet --version
2.6.6

root@zonnevis:/# puppet apply  test.pp 
notice: /Stage[main]//Cron[testcron]/ensure: created
# HEADER: This file was autogenerated at Thu Apr 07 10:39:07 +0200 2011 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
notice: Finished catalog run in 0.24 seconds
root@zonnevis:/# crontab -l nobody
crontab: you are not authorized to use cron.  Sorry.

So Puppet still claims they installed it the cron however crontab -l reports there is no cron. (And there should be any for those users).

I have also retested my other claim (regarding */5 entry format). Puppet also says that cron was successfully installed. But it isn’t.

Updated by Nigel Kersten 9 months ago

  • Assignee deleted (Jesse Wolfe)

Updated by James Turnbull 3 months ago

  • Status changed from Re-opened to Accepted
  • Keywords set to cron solaris

Also available in: Atom PDF