Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Fri Nov 24, 2017 5:37 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Oct 11, 2012 4:51 pm 
Offline
Newbie

Joined: Mon Jan 03, 2011 1:35 am
Posts: 8
Hi, I own a Buffalo NAS Linkstation LS-XHL flashed with 1.60 firmware (Shonk mod).
I just flashed it, reset settings to default, gained telnet and SSH root access. I needed a DDNS updater, so I installed ipkg, and then updatedd. After that I configured updatedd according to my dyndns account parameters. I run the program through ssh terminal logged as root and works perfectly.
So I decided to create a cron job to execute it every 5 minutes
/etc/cron/crontabs/root
Code:
00 0 * * * /etc/cron/cron.d/mailnotice.sh
05 4 * * * /etc/cron/cron.d/logrotate -f
10 4 * * * /etc/cron/cron.d/check_smart.sh
*/5 * * * * /etc/cron/cron.d/logrotate
08 4 * * * /etc/cron/cron.d/calib_time.sh
47 */3 * * * /etc/cron/cron.d/ntpdate
00 3 * * * /etc/cron/cron.d/date_to_lcd
*/30 * * * * /etc/cron/cron.d/ms_checkversion.sh
*/5 * * * * /opt/bin/updatedd-wrapper


Then to apply the changes, /etc/init.d/cron.sh restart did the job. It works as expected. Great.
However, I then realized every time I reboot the system the cron jobs are not entirely executed, or not executed at all. I have to manually restart cron.sh for them to work.
Still, the cron are being logged as executed under the cron log, but there are no instances of any execution on linkstation.log and they are not executed.

I rebooted the NAS at 11:10 and copied the logs for you:


/var/log/cron [COMPLETE LOGS BETWEEN REBOOT AT 11:10 AND 12:00]
Code:
Oct 11 11:13:24 NAS-XHL crond[2044]: crond 1.7.0 started, log level 8 
Oct 11 11:15:01 NAS-XHL crond[2044]: USER root pid 2927 cmd /etc/cron/cron.d/logrotate
Oct 11 11:15:01 NAS-XHL crond[2044]: USER root pid 2929 cmd /opt/bin/updatedd-wrapper
Oct 11 11:20:01 NAS-XHL crond[2044]: USER root pid 4333 cmd /etc/cron/cron.d/logrotate
Oct 11 11:20:01 NAS-XHL crond[2044]: USER root pid 4335 cmd /opt/bin/updatedd-wrapper
Oct 11 11:25:01 NAS-XHL crond[2044]: USER root pid 5748 cmd /etc/cron/cron.d/logrotate
Oct 11 11:25:01 NAS-XHL crond[2044]: USER root pid 5750 cmd /opt/bin/updatedd-wrapper
Oct 11 11:30:01 NAS-XHL crond[2044]: USER root pid 7137 cmd /etc/cron/cron.d/logrotate
Oct 11 11:30:01 NAS-XHL crond[2044]: USER root pid 7139 cmd /etc/cron/cron.d/ms_checkversion.sh
Oct 11 11:30:01 NAS-XHL crond[2044]: USER root pid 7140 cmd /opt/bin/updatedd-wrapper
Oct 11 11:35:01 NAS-XHL crond[2044]: USER root pid 8548 cmd /etc/cron/cron.d/logrotate
Oct 11 11:35:01 NAS-XHL crond[2044]: USER root pid 8550 cmd /opt/bin/updatedd-wrapper
Oct 11 11:40:01 NAS-XHL crond[2044]: USER root pid 9954 cmd /etc/cron/cron.d/logrotate
Oct 11 11:40:01 NAS-XHL crond[2044]: USER root pid 9956 cmd /opt/bin/updatedd-wrapper
Oct 11 11:45:01 NAS-XHL crond[2044]: USER root pid 11360 cmd /etc/cron/cron.d/logrotate
Oct 11 11:45:01 NAS-XHL crond[2044]: USER root pid 11362 cmd /opt/bin/updatedd-wrapper
Oct 11 11:50:01 NAS-XHL crond[2044]: USER root pid 12749 cmd /etc/cron/cron.d/logrotate
Oct 11 11:50:01 NAS-XHL crond[2044]: USER root pid 12751 cmd /opt/bin/updatedd-wrapper
Oct 11 11:55:01 NAS-XHL crond[2044]: USER root pid 14155 cmd /etc/cron/cron.d/logrotate
Oct 11 11:55:01 NAS-XHL crond[2044]: USER root pid 14157 cmd /opt/bin/updatedd-wrapper
Oct 11 12:00:01 NAS-XHL crond[2044]: USER root pid 15544 cmd /etc/cron/cron.d/logrotate


/var/log/linkstation.log [COMPLETE LOGS BETWEEN REBOOT AT 11:10 AND 12:00]
Code:
Oct 11 11:12:01 NAS-XHL twonky: Media Server script is begun. type=stop 
Oct 11 11:12:01 NAS-XHL twonky: stop Media Server
Oct 11 11:12:05 NAS-XHL bittorrent: WaitBtDie is finished.
Oct 11 11:12:07 NAS-XHL ups.sh: Successfully stopped!
Oct 11 11:12:11 NAS-XHL dhcpcd[1622]: terminating on signal 15
Oct 11 11:12:11 NAS-XHL dhcpcd[1622]: ** DontDownIface=1
Oct 11 11:12:11 NAS-XHL dhcpcd.exe: interface eth1 has been brought down
Oct 11 11:12:12 NAS-XHL linkstation: Stopped rarpd tftpd rarpcfgd fwupdated
Oct 11 11:12:12 NAS-XHL ups.sh: Successfully stopped!
Oct 11 11:13:14 NAS-XHL linkstation: Started inetd
Oct 11 11:13:14 NAS-XHL linkstation: Started errormon
Oct 11 11:13:14 NAS-XHL linkstation: Started kernelmon
Oct 11 11:13:15 NAS-XHL kernelmon: cmd=lanact 100 full eth1
Oct 11 11:13:20 NAS-XHL linkstation: Started logchkd
Oct 11 11:13:24 NAS-XHL linkstation: cron.sh : logrotate.status is fine.
Oct 11 11:13:29 NAS-XHL demorons(657) - INFO - found.
Oct 11 11:13:29 NAS-XHL twonky: Media Server script is begun. type=start
Oct 11 11:13:31 NAS-XHL -p: Not started iTunes Server. DNLA_SERVER is setted to []
Oct 11 11:13:36 NAS-XHL root: linkstation
Oct 11 11:13:38 NAS-XHL kernelmon: cmd=PSW_on
 

See how after boot completes, cron jobs aren't executed?

If I restart the cron.sh, the cron jobs start working and I get logs of ntp syncing and updatedd like these in linkstation.log
Code:
Oct 11 06:47:05 NAS-XHL linkstation: [Success] Sync to ntp server
Oct 11 06:50:04 NAS-XHL updatedd: dyndnsaddress: No changes, update considered abusive.


Any idea what the problem is?


Top
   
PostPosted: Thu Oct 11, 2012 6:20 pm 
Offline
Regular Member

Joined: Sun May 06, 2012 1:45 am
Posts: 186
RooKiED wrote:
See how after boot completes, cron jobs aren't executed?

If I restart the cron.sh, the cron jobs start working and I get logs of ntp syncing and updatedd like these in linkstation.log
Code:
Oct 11 06:47:05 NAS-XHL linkstation: [Success] Sync to ntp server
Oct 11 06:50:04 NAS-XHL updatedd: dyndnsaddress: No changes, update considered abusive.


Any idea what the problem is?

You do realize that ntpdate only runs once every 3 hours?

Try putting some debugging into updatedd-wrapper to see when/if it is being called by cron. i.e.

Code:
date >> /mylog.txt


Also try "ps w" to see if the process is hanging.


Top
   
PostPosted: Thu Oct 11, 2012 8:41 pm 
Offline
Newbie

Joined: Mon Jan 03, 2011 1:35 am
Posts: 8
Thanks for the tips ColinTaylor. I solved it.
Cron.sh was executing fine, in fact NTP synced after the 3 hour period :p. The problem was the new updatedd cron job.
I did exactly what you said and I discovered the problem. I captured stdout and stderr output of the script and the error was not finding files on certain paths. I solved it writing the full path for all the calls made in the script.
Thanks for your patience.


Top
   
PostPosted: Thu Oct 11, 2012 9:10 pm 
Offline
Regular Member

Joined: Sun May 06, 2012 1:45 am
Posts: 186
Well done for working that out.

All the best, Colin.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited