Multiple invocations of cron-job AT THE SAME MINUTE on Raspbian

Ajay Garg ajaygargnsit at gmail.com
Thu Sep 15 02:22:38 PDT 2016


Hi All.

Sorry for sounding desperate, but it's my earnest request to all the
experts, to kindly shed some light on this.

We are facing issues in field only on the Raspberry-Pi units, while
the units of other types running the exact same startup-script work
perfect.


Thanks and Regards,
Ajay

On Thu, Sep 15, 2016 at 11:08 AM, Ajay Garg <ajaygargnsit at gmail.com> wrote:
> Hi All.
>
> I have a raspbian-pi-3, and following is the first-level information ::
>
> ########################################
> uname -a
> Linux raspberrypi 4.4.11-v7+ #888 SMP Mon May 23 20:10:33 BST 2016
> armv7l GNU/Linux
> ########################################
>
>
>
> Following is the script that is run by the every-minute cron ::
>
> ########################################
> PID=`ps -aux | grep instamsg | grep -v grep | grep -v tail`
>
> if [ -z "${PID}" ]
> then
>     echo "Binary not running"
>     cd /home/sensegrow
>     chmod 777 instamsg
>
>     sleep 3
>     ./instamsg &
> else
>     echo "Binary running fine"
> fi
> ########################################
>
>
>
> Now, things are mostly fine, but very spuriously, I see that multiple
> instances of "instamsg" are spawned, sometimes upto 5, ALL IN THE SAME
> MINUTE.
> The occurrence of such phenomena is like once in a day.
>
> I know there are multiple posts about this on the internet, but all of
> those point to faulty-script(s) that are run as part of cron.
> However, I guess the script I am using is pretty simple, and can never
> be "long-running, longer than a minute".
>
> Please note that I may solve this by using the lock-file mechanism,
> but I wish to know the root-cause, as the same script runs without any
> issues for days the on Maestro-Wireless routers, and Lanner-systems
> running Ubuntu.
>
> In particular, could this be an issue with the cron-daemon code on
> Raspbian-kernel, which could (in spurious cases) spawn multiple
> instances of the same cron-job in the same minute?
>
>
> Thanks and Regards,
> Ajay



-- 
Regards,
Ajay



More information about the linux-rpi-kernel mailing list