[solved] CRON standby and autowakeup not working as expected

[solved] CRON standby and autowakeup not working as expected

Postby cyrilcacyril » Mon Oct 26, 2020 9:39 am

Hi,

I would like to put my NAS to bed in the evening automatically, and have it wake up in the morning. I can do that manually in the web interface (18.2), via System Shutdown/Restart - Nas Standby and Auto wake-up / XXX minutes. The system stops, and restarts automatically after XXX minutes.

However, when I try to do the same with a CRON job, the NAS goes to standby at the desired time, but then reboots about two minutes after, systematically. E.g. if I set the CRON job to :
Code: Select all
25   9   *   *   *      Nas Standby and auto wake-up (250 min)


... I get an email at 9:25
NAS will be wake up after 250 minutes
or by sending a WOL magic packet to the MAC address (...)


... and then another email at 9:27
start boot log
is a physical machine
detect and set platform
2big2
kirkwood
UIMAGE-414133-KIRKWOOD-1
Current kernel: 4.14.133 #1 PREEMPT Wed Jul 17 14:46:56 CEST 2019
2big2
kirkwood
mount dev/pts
update dev nodes
booting using sda1 root file system...
enable IP forwarding...
run udevstart to update dev nodes when necessary
inserting kernel modules:
modprobe: module 'iscsi_trgt' not found
start buttons control daemon
device = 2big2
source = buttons-nwsp2
buttons-nwsp2 daemon started
Mon Oct 26 09:25:58 CET 2020
create temporary passwd file
create temporary group file
set samba environment for version 4.x
configure loopback network interface
setting reboot and standby
2big2
rebootd-nwsp2
2big2
standbyd-nwsp2
start fan
starting php based setup routines step 1
* Initialize the volatile db file... [ OK ]
* Starting udevd... [ OK ]
* Starting RAID monitor: [ OK ]
* Starting restore RAID devices...
- Assembling device /dev/md0: [ OK ]
* Finishing restore RAID devices... [ OK ]
* Found database configuration file... [ OK ]
* Updating Disks database... [ OK ]
* Starting mount of volumes...
- Mounting volume RAID: [ OK ]
* Finishing mount of volumes... [ OK ]
* Generating Hosts File... [ OK ]
* Configuring System Hostname... [ OK ]
* Configuring LAN interface... [ OK ]
* Initializing Timezone... [ OK ]
* Starting web server... [ OK ]
* Starting mount of internal USB ...
* Finishing mount internal USB ... [ OK ]
* Configuring Disks... [ OK ]
* Configuring Samba... [ OK ]
* Configuring System Users...
Root password: use custom password
Set users, linux and samba accounts [ OK ]
* Starting Fvdw-sl Discovery Daemon... [ OK ]
start rpcbind service
starting php based setup routines step 2
* Starting dropbear... [ OK ]
* Kill temporary dropbear... [ OK ]
starting php based setup routines step 3
* Starting Explorer Service... [ OK ]
* Starting daemon update Hosts File... [ OK ]
* Starting Disk Temperature Guard... [ OK ]
* Starting mount of remote shares...
* Finishing mount shares... [ OK ]
* Starting NTP client... [ OK ]
* Starting CRON Service... [ OK ]
* Starting vnstat daemon... [ OK ]
starting php based setup routines step banner


*** fvdw-sl NAS firmware
This is fvdw-sl version: fvdw-sl 18.2
built on: October 18 2019

LAN IP address: 192.168.1.112 (DHCP)

Port configuration:

LAN -> eth0
php based setup routines finished
web permission on resolv.conf
set device tuning for dms performance
move smbd en nmbd db files away from ram disk to prevent hanging samba server
LED settings

Send a boot mail notification to (...)


The output on the CRON log file only contains:
Code: Select all
2020/10/26 09:25:01: Standby with suspended time (250)


I have neither Torrent nor Media servers running. In the Advanced options for shutdown, the list of IP addresses to monitor is empty.

So, I think something is wrong with the CRON job, either in the way I set it, or with the command itself. Is it ignoring the amount of seconds I ask it to sleep, or is there another issue?

Thanks a lot for your support :thumbup
Last edited by cyrilcacyril on Thu Oct 29, 2020 7:03 pm, edited 1 time in total.
cyrilcacyril
Donator VIP
Donator VIP
 
Posts: 3
Joined: Sun Oct 18, 2020 7:53 pm

Re: CRON Nas standby and autowakeup not working as expected

Postby Jocko » Thu Oct 29, 2020 1:13 pm

Hi

Indeed there was a bug.
cyrilcacyril wrote:However, when I try to do the same with a CRON job, the NAS goes to standby at the desired time, but then reboots about two minutes after, systematically.
It is because the cron job made a simple reboot. On a wol standby, you have an additional line in /boot.log
Code: Select all
waiting for WOL magic packet..
which is missing on your output.

The cron boot job did not create a file in the right location and then the boot script was not stopped.

Pleae to test the patch
Code: Select all
plugout download 6598
tar -xf '/tmp/fvdw-sl-18-2-fix-suspend-time-29oct2020.tgz' -C /


No need to reboot the nas
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: CRON Nas standby and autowakeup not working as expected

Postby cyrilcacyril » Thu Oct 29, 2020 7:02 pm

Hi Jocko,

Perfect! I was able to download and install the patch with the web console, and I can confirm that the cron job now correctly suspends the NAS for the amount of time I specify.

Merci beaucoup pour ta réactivité :woohoo
cyrilcacyril
Donator VIP
Donator VIP
 
Posts: 3
Joined: Sun Oct 18, 2020 7:53 pm


Return to Lacie 2Big Network vs2

Who is online

Users browsing this forum: No registered users and 4 guests

cron