OpenVZ Forum


Home » Mailing lists » Users » PATCH for small cron prob. in /etc/init.d/vz
PATCH for small cron prob. in /etc/init.d/vz [message #23562] Sat, 17 November 2007 07:06 Go to next message
proto is currently offline  proto
Messages: 2
Registered: November 2007
Junior Member
From: openvz.org
The init script in vzctl-3.0.18 installs the file:
  /etc/cron.d/vz
as part of its startup,  what is strange as that on CentOS5 at least the 
last mod of the folder /etc/cron.d is NOT updated!

What this means its that CRON does not know about the new file as as 
such does not run it.

Hope this info helps,
Gérald

Here is a quick patch to fix the prob:

--- /etc/init.d/vz_orig     2007-07-31 16:54:05.000000000 -0400
+++ /etc/init.d/vz  2007-11-17 01:56:30.000000000 -0500
@@ -131,6 +131,7 @@
        [ -d "$SRC_CRONSCRIPT_DIR" ] || return
        cat $SRC_CRONSCRIPT_DIR/vz* > $DST_CRONSCRIPT_DIR/vz && \
                chmod 644 $DST_CRONSCRIPT_DIR/vz
+       touch -m $DST_CRONSCRIPT_DIR
 }
 
 remove_cron()
Re: PATCH for small cron prob. in /etc/init.d/vz [message #23563 is a reply to message #23562] Tue, 20 November 2007 12:06 Go to previous message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

From: openvz.org
I see that as a workaround. We'd better find a reason why it happens 
that way.

Can you demonstrate that mtime of /etc/cron.d is not changed?

PS please consider subscribing for users@

Gerald Villemure wrote:
> The init script in vzctl-3.0.18 installs the file:
>  /etc/cron.d/vz
> as part of its startup,  what is strange as that on CentOS5 at least 
> the last mod of the folder /etc/cron.d is NOT updated!
>
> What this means its that CRON does not know about the new file as as 
> such does not run it.
>
> Hope this info helps,
> GĂ©rald
>
> Here is a quick patch to fix the prob:
>
> --- /etc/init.d/vz_orig     2007-07-31 16:54:05.000000000 -0400
> +++ /etc/init.d/vz  2007-11-17 01:56:30.000000000 -0500
> @@ -131,6 +131,7 @@
>        [ -d "$SRC_CRONSCRIPT_DIR" ] || return
>        cat $SRC_CRONSCRIPT_DIR/vz* > $DST_CRONSCRIPT_DIR/vz && \
>                chmod 644 $DST_CRONSCRIPT_DIR/vz
> +       touch -m $DST_CRONSCRIPT_DIR
> }
>
> remove_cron()
>
>
>
Previous Topic: venet0: hw csum failure.
Next Topic: Reapplying an OS template
Goto Forum:
  


Current Time: Wed Nov 14 08:45:44 GMT 2018