DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-11-02 12:52:22

Mattiews
New member
Registered: 2011-11-02
Posts: 2

crontab - crond is not running

Hello,

I use FFP 0.5 and I have a problem with crontab.

I put standards files crond.sh and cronjobs.sh in ffp/start.

Jobs are added normally when NSA start.

/ffp/start/crond.sh status -> crond is running normally.

First job start normally and then

/ffp/start/crond.sh status -> crond is not running

Second job doesn't start

Any Idea ?

Thanks

Offline

 

#2 2011-11-03 15:24:18

Mattiews
New member
Registered: 2011-11-02
Posts: 2

Re: crontab - crond is not running

In fact crond stop at the end of a few minutes

Code:

root@nsa221:~# date
Thu Nov  3 14:34:06 CET 2011
root@nsa221:~# /ffp/start/crond.sh status
crond is running normally
root@nsa221:~# date
Thu Nov  3 14:40:10 CET 2011
root@nsa221:~# /ffp/start/crond.sh status
crond is not running

crond.sh

Code:

#!/ffp/bin/sh

# PROVIDE: crond
# REQUIRE: LOGIN

. /ffp/etc/ffp.subr

name="crond"
start_cmd="crond_start"
stop_cmd="crond_stop"
status_cmd="crond_status"

crond_start()
{
  cronfile=/var/run/crond.pid
  
  #get the pid, if it exists
  if [ ! -f $cronfile ];then
    crond -b -L /mnt/HD_a2/logs/cron.log
    return
  fi
    thispid=`cat $cronfile`
  if [ ! -d /proc/$thispid ];then
    crond -b -L /mnt/HD_a2/logs/cron.log
    return
  else
    echo "crond is already running"
  fi
}

crond_stop()
{
  cronfile=/var/run/crond.pid
  
  #get the pid, if it exists
  if [ ! -f $cronfile ];then
      echo "crond is not running"
      return
  fi
      thispid=`cat $cronfile`
  if [ ! -d /proc/$thispid ];then
      echo "crond is not running"
  else
      kill -9 $thispid
  fi
  
}

crond_status()
{
  cronfile=/var/run/crond.pid
  
  #get the pid, if it exists
  if [ ! -f $cronfile ];then
    echo "crond is not running"
    return
  fi
  thispid=`cat $cronfile`
  if [ ! -d /proc/$thispid ];then
    echo "crond is not running"
  else
    echo "crond is running normally"
  fi
}

run_rc_command "$1"

What is it necessary to make that crond is always running ?

Last edited by Mattiews (2011-11-03 15:43:26)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB