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 2010-01-10 20:36:21

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

crond Addtion to Wiki

njoy added a neat little  Cron jobs ffp script to the Wiki. I've built both scripts and will be using such as an alternate to editing crontab during start-up. The cronjobs.sh script includes the lines;

Code:

# PROVIDE: cronjobs
# REQUIRE: LOGIN

If I'm not mistaken and to ensure crond is running (crond.sh will be placed in the /ffp/start folder) I would need to add a line that reads #REQUIRES: crond. The resulting code would look like;


Code:

# PROVIDE: cronjobs
# REQUIRE: LOGIN
# REQUIRES: crond

Is my assumption correct?

Last edited by rcblackwell (2010-01-10 20:36:40)


Bob Blackwell
Pickering, ON

Offline

 

#2 2010-01-10 20:42:32

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: crond Addtion to Wiki

Nope. The cron service (crond) is a firmware program, and it's started before fun_plug runs. Also, the Require lines in the start scripts don't specify dependencies on real programs. If you add "REQUIRE: crond", you need another start script that has "PROVIDE: crond". But since crond is a firmware program, there's no start script for it.

Offline

 

#3 2010-01-11 00:35:03

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: crond Addtion to Wiki

fonz wrote:

Nope. The cron service (crond) is a firmware program, and it's started before fun_plug runs. Also, the Require lines in the start scripts don't specify dependencies on real programs. If you add "REQUIRE: crond", you need another start script that has "PROVIDE: crond". But since crond is a firmware program, there's no start script for it.

The Wiki provides detail for two scripts. One named crond.sh and one named cronjobs.sh. Within the crond.sh script is a PROVIDE: crond declaration. I assume this is what you refer to thus I'm thinking as long as crond.sh runs at startup then I could include the REQUIRE: crond declaration in the cronjobs.sh script?

I've spent a little more time analyzing the two scripts and have concluded I don't understand the value of the either. If the cron service is a FW program why is there a link to crond in ffp? When should one be used over the other; the firmware version of cron over /ffp/bin/busybox version?

I see the cronjobs.sh script listed in the Wiki adds jobs to crontab. Are cron jobs for both the firmware and /ffp/busybox versions of cron stored there?


Bob Blackwell
Pickering, ON

Offline

 

#4 2010-01-11 09:44:10

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: crond Addtion to Wiki

If the firmware has crond, there's no reason not to use it. But there may be devices that don't have crond in their firmware. ffp has it, then.

PS: You're right that when you're using the crond script, too, it's best to add crond to the REQUIRE list to ensure that crond runs first. You can check the order of start scripts with rcorder:

Code:

# rcorder /ffp/start/*.sh
/ffp/start/syslogd.sh
...

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB