Re: [Cronie-devel] Bug: Cron-Daemon can run twice
by Marcela Mašláňová
On 01/18/2013 02:36 PM, Thomas Guettler wrote:
> if the pid-file gets lost, and start cronie again, it will run twice:
>
> workdevel114:~ # rm /var/run/cron.pid
> workdevel114:~ # /etc/init.d/cron start
>
> Cronjobs get executed twice:
>
> Jan 18 13:50:15 workdevel114 /usr/sbin/cron[20730]: (CRON) INFO (@reboot
> jobs will be run at computer's startup.)
> Jan 18 13:51:01 workdevel114 /USR/SBIN/CRON[20816]: (modwork_eins_d) CMD
> (. ~/.bashrc && date >> log/date.log)
> Jan 18 13:51:01 workdevel114 /USR/SBIN/CRON[20828]: (modwork_eins_d) CMD
> (. ~/.bashrc && date >> log/date.log)
>
> Version cronie-1.4.7-9.23.1.x86_64 openSUSE 11.4 (x86_64)
>
> I don't know how, but it has happend on one of our servers.
>
> I think this is a bug, since cron should not run twice.
>
> Thomas
>
Fedora has systemd now, so there is problem not reproducible. I tested
the issue on older releases, it's working as you are saying, but I guess
that's the correct behaviour of classical init script. If the pid is
there, then start won't be executed, otherwise daemon will start.
I'm also not sure if you distribution isn't using their own version of
init script, because my pidfile is called crond.pid. You will need to
report it to your distribution if you still believe it's a bug.
Marcela
11 years, 3 months
[PATCH 0/6] fixes I forgot to sent earlier
by Sami Kerola
On Wed, Jan 16, 2013 at 7:15 PM, Tomas Mraz <tmraz(a)redhat.com> wrote:
> Not really, the patches from your batch that were not commented about
> were already commited. The rest of them are waiting for you to fix or
> drop.
Hi Tomas & Marcela,
Oh, sorry. My bad. I wrote corrections to the patches but did not
submit them to list, but pushed only to my branch at github. I do
not know what I were thinking, but perhaps submission later is better
than never. Notice that the patches I sent yesterday are these six
without 'signed-off-by' lines, feel free to use them if signing is
not preferred.
The following changes since commit
c508ac6a34c8ccca0d831a69536457acb62d0c1d:
contrib: remove bashisms (2012-12-21 22:14:30 +0100)
are available in the git repository at:
git://github.com/kerolasa/cronie.git 2012wk52
for you to fetch changes up to 59a5448efaf41b91bb6c0da8b2f78ac4b586b8d1:
cron: clarify usage() print out (2012-12-31 12:57:35 +0000)
----------------------------------------------------------------
Sami Kerola (6):
smatch scan: fix various warningss found using smatch
anacron: fix shadow declarations
anacron: use random device for random sleep when possible
common: add gethostname() support functions
cron, anacron: take safe gethostname() function in use
cron: clarify usage() print out
anacron/global.h | 4 ++--
anacron/main.c | 37 +++++++++++++++++++++++++------------
anacron/readtab.c | 19 ++++++++++---------
anacron/runjob.c | 8 ++++----
cronie_common.h | 38 ++++++++++++++++++++++++++++++++++++++
src/crontab.c | 29 +++++++++++++++++------------
src/database.c | 10 +++++++---
src/do_command.c | 6 ++++--
src/entry.c | 6 ++----
src/macros.h | 2 ++
src/security.c | 2 +-
11 files changed, 112 insertions(+), 49 deletions(-)
11 years, 3 months
[PATCH 00/15] pull: gethostname, usage(), and standardization
by Sami Kerola
Hello,
Here is my second set of patches to cronie. Most of the stuff is fairly
trivial, expect perhaps the gethostname() changes. The reason why static
character array is not good enough is documented to commit message.
Short version of the explanation is that fixed lenght array might 1 run
out on some systems, and 2 has unfortunate overflow possibility.
For users the most visitble change in this patch series is usage() output
changes. IMHO having as brief syntax explanation as possible, and
options described with arguments is better than old format.
The patches are also available in my github branch, just in case someone
in audience prefers doing merges with remote repository rather than
emails.
The following changes since commit 3674fa36412650688392676e2f7cfef56f5b6bea:
New release 1.4.10. (2012-11-27 10:35:28 +0100)
are available in the git repository at:
git://github.com/kerolasa/cronie.git 2012wk48
for you to fetch changes up to f4425685fd4981c5c61b1405a7e5229f0f2402e2:
init script: remove bashisms (2012-12-02 00:16:52 +0000)
----------------------------------------------------------------
Sami Kerola (15):
crontab: make usage easier to read
crond: make usage easier to read
compliancy: use sysconf() to determine max hostname length
smatch scan: fix various warningss found using smatch
compile: fix signed and unsigned warnings
compile: add function attributes
anacron: add function attributes
anacron: fix shadow declarations
anacron: remove unnecessary casts, and redundant assigment
anacron: set end job message string to be constant
anacron: clean up usage() output
anacron: remove numeric exit and file descriptor values
common: move xgethostname to cronie_common.h
anacron: make function declarations to be ansi compliant
init script: remove bashisms
Makefile.am | 14 +++++++--
anacron/global.h | 5 ++--
anacron/log.c | 82 +++++++++++++++++++++++++-------------------------
anacron/main.c | 90 +++++++++++++++++++++++++++----------------------------
anacron/readtab.c | 8 ++---
anacron/runjob.c | 26 ++++++++--------
configure.ac | 45 ++++++++++++++++++++++++++++
cronie.init | 16 +++++-----
cronie_common.h | 66 ++++++++++++++++++++++++++++++++++++++++
src/cron.c | 37 +++++++++++++----------
src/crontab.c | 62 ++++++++++++++++++++++++--------------
src/database.c | 11 +++++--
src/do_command.c | 8 +++--
src/entry.c | 6 ++--
src/macros.h | 2 +-
src/misc.c | 3 +-
src/security.c | 10 +++++--
17 files changed, 323 insertions(+), 168 deletions(-)
create mode 100644 cronie_common.h
11 years, 3 months