RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1114815 - cron.service does not implement reload in redhat 7
Summary: cron.service does not implement reload in redhat 7
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: cronie
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Marcela Mašláňová
QA Contact: Jakub Prokes
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-01 05:21 UTC by zpczjl
Modified: 2015-03-09 11:07 UTC (History)
4 users (show)

Fixed In Version: cronie-1.4.11-13.el7
Doc Type: Bug Fix
Doc Text:
Previously, the cron unit file did not have support for the reload function and the crond daemon could therefore not reload. As a consequence, users had to restart crond when they needed the configuration to be reloaded. This update adds support for reloading into the cron unit file and the reload function now works as expected.
Clone Of:
Environment:
Last Closed: 2015-03-09 11:07:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0947 0 normal SHIPPED_LIVE cronie bug fix update 2014-07-29 14:34:51 UTC

Description zpczjl 2014-07-01 05:21:24 UTC
Description of problem:

============
[root@localhost ~]# service crond reload
Redirecting to /bin/systemctl reload  crond.service
Failed to issue method call: Job type reload is not applicable for unit crond.service.
============

Version-Release number of selected component (if applicable):
============
[root@localhost ~]# rpm -qa |grep cron
cronie-anacron-1.4.11-11.el7.x86_64
crontabs-1.11-6.20121102git.el7.noarch
cronie-1.4.11-11.el7.x86_64
============
============
[root@localhost ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.0 (Maipo)
============

Comment 1 zpczjl 2014-07-01 05:23:17 UTC
If reload is decrepited, please tell me the alternative solution.

Comment 3 Marcela Mašláňová 2014-07-02 17:26:14 UTC
Thanks for report. You are right, reload is missing.

Initscripts in RHEL were mostly converted to unit files used by systemd. I rewrote the script so long time ago, that classical reload wasn't supported yet. As a workaround I would recommend change your unit file /lib/systemd/system/crond.service to:
[Unit]
Description=Command Scheduler
After=syslog.target auditd.service systemd-user-sessions.service time-sync.target

[Service]
EnvironmentFile-=/etc/sysconfig/crond
ExecStart=/usr/sbin/crond -n $CRONDARGS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process

[Install]
WantedBy=multi-user.target

The important new line is ExecReload.

After change of unit file you need to call:
systemctl --system daemon-reload
After that classical reload should work. Please, let me know if it's working as expected.

Comment 4 zpczjl 2014-07-03 02:29:59 UTC
Dear Marcela,

Thanks for your response.

But I am a RD engineer and trying to make my product support RedHat 7.
In our product, we invoke this command "service crond reload" in some logic.
I think the workaround you provided is just for individual customer, we can not adopt it.

From "/etc/init.d/crond" of redhat 6, I know you reload the cronjob by 
sending SIGHUP to the process. I have considered that I can replace "service crond reload" by "send SIGHUP to crond process" in my program. 
But I am worried about this undocumented method. I am not sure if "send SIGHUP to crond process" still equal to "service crond reload" in future's crond version.
Maybe none can guarantee this.

So Maybe I have to use "service crond restart" to replace "service crond reload" in my program. 

Would you please give some suggestions based on my scenario?

tnx,
Leon

Comment 5 Marcela Mašláňová 2014-07-03 05:45:58 UTC
Cron is reloaded by SIGHUP, so it sounds better to me. Restart would restart daemon, which might bring unexpected behaviour in some cases. Users were complaining especially while using LDAP (should be fixed now).

I hope I'll be able to push fix mentioned in my previous comment into RHEL-7.1.

Comment 6 zpczjl 2014-07-03 09:11:18 UTC
Thanks for your suggestion.


Note You need to log in before you can comment on or make changes to this bug.