What's new

User scripts are not called at reboot

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Sharbe

Occasional Visitor
Hello guys, I need some help, please.

ASUS RT-N66U with latest Merlin's build.

I placed the "Scheduled LED control" scripts in /jfss/scripts/ , and afterwards chmod it to a+rx.
I also added nat-start and wan-start to get direct access to my modems webGUI.

When I run the scripts manually via telnet, it runs like expected, but the scripts are not called at reboot.

So, what could be wrong?

Thanks in advance,
Sharbe
 
...you need to integrate the trigger into the services-start script, as stated on git.

Code:
Next, either create the following services-start script (or add to any existing script):

services-start:

#!/bin/sh
cru a lightsoff "0 18 * * * /jffs/scripts/ledsoff.sh"
cru a lightson "0 6 * * * /jffs/scripts/ledson.sh"
 
I followed the guide Scheduled LED control as stated on git.
I had created services-start, ledson.sh, ledsoff.sh. Then saved them in /jffs/scripts/ and afterwards chmod all scripts to a+rx.

Then, I have had reboot my router.
To confirm that the jobs are properly set up I had run the following command through telnet:
Code:
cru l
None of the scheduled tasks had listed.

After running the scripts manually I checked "cru l" again and all tasks had listed now.

To test it again, I rebooted the router once more, but again none of the tasks were run after reboot :(...
 
Hmm....strange.
Just to confirm...when running the single services-start script manually, the led-scripts get triggered successfully?
 
I restarted my router again just to check it:
See my telnet log, please:

Code:
RT-N66U login: admin
Password:


ASUSWRT-Merlin RT-N66U_3.0.0.4 Fri Jan 31 05:20:15 UTC 2014
admin@RT-N66U:/tmp/home/root# cru l
admin@RT-N66U:/tmp/home/root# /jffs/scripts/services-start
admin@RT-N66U:/tmp/home/root# cru l
30 23 * * * /jffs/scripts/ledsoff.sh #lightsoff#
45 5 * * * /jffs/scripts/ledson.sh #lightson#

I have no idea what is running wrong here ...
 
I restarted my router again just to check it:
See my telnet log, please:

Code:
RT-N66U login: admin
Password:


ASUSWRT-Merlin RT-N66U_3.0.0.4 Fri Jan 31 05:20:15 UTC 2014
admin@RT-N66U:/tmp/home/root# cru l
admin@RT-N66U:/tmp/home/root# /jffs/scripts/services-start
admin@RT-N66U:/tmp/home/root# cru l
30 23 * * * /jffs/scripts/ledsoff.sh #lightsoff#
45 5 * * * /jffs/scripts/ledson.sh #lightson#

I have no idea what is running wrong here ...

Post the output of the following commands:

Code:
mount
ls   -l   /jffs
ls   -l   /jffs/scripts

Regards,
 
Here we go:
Code:
RT-N66U login: admin
Password:


ASUSWRT-Merlin RT-N66U_3.0.0.4 Fri Jan 31 05:20:15 UTC 2014
admin@RT-N66U:/tmp/home/root# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
proc on /proc type proc (rw)
tmpfs on /tmp type tmpfs (rw)
devfs on /dev type tmpfs (rw,noatime)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw)
/dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw)
admin@RT-N66U:/tmp/home/root# ls -l /jffs
drwxr-xr-x    2 admin    root             0 Jan  1  2011 configs
drwxr-xr-x    2 admin    root             0 Feb 17 16:53 scripts
admin@RT-N66U:/tmp/home/root# ls -l /jffs/scripts/
-rwxrwxrwx    1 admin    root            81 Feb 17 16:53 ledsoff.sh
-rwxrwxrwx    1 admin    root            79 Feb 17 16:53 ledson.sh
-rwxrwxrwx    1 admin    root           536 Feb 17 16:52 nat-start
-rwxrwxrwx    1 admin    root           228 Feb 17 16:53 services-start
-rwxrwxrwx    1 admin    root           843 Feb 17 16:53 wan-start
admin@RT-N66U:/tmp/home/root#
 
Here we go:
Code:
RT-N66U login: admin
Password:


ASUSWRT-Merlin RT-N66U_3.0.0.4 Fri Jan 31 05:20:15 UTC 2014
admin@RT-N66U:/tmp/home/root# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
proc on /proc type proc (rw)
tmpfs on /tmp type tmpfs (rw)
devfs on /dev type tmpfs (rw,noatime)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw)
/dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw)
admin@RT-N66U:/tmp/home/root# ls -l /jffs
drwxr-xr-x    2 admin    root             0 Jan  1  2011 configs
drwxr-xr-x    2 admin    root             0 Feb 17 16:53 scripts
admin@RT-N66U:/tmp/home/root# ls -l /jffs/scripts/
-rwxrwxrwx    1 admin    root            81 Feb 17 16:53 ledsoff.sh
-rwxrwxrwx    1 admin    root            79 Feb 17 16:53 ledson.sh
-rwxrwxrwx    1 admin    root           536 Feb 17 16:52 nat-start
-rwxrwxrwx    1 admin    root           228 Feb 17 16:53 services-start
-rwxrwxrwx    1 admin    root           843 Feb 17 16:53 wan-start
admin@RT-N66U:/tmp/home/root#


Well, if the router clearly shows that JFFS is ACTIVE as per the screenshot,
then if the following

Code:
cd /jffs/scripts
./services-start

shows no errors, and U have included trace ('logger' or 'echo') statements that appear as expected, then there must be a problem locating the script files at boot time?

Regards,
 

Attachments

  • 17-02-2014 19-10-55.jpg
    17-02-2014 19-10-55.jpg
    15.6 KB · Views: 271
if in doubt use WinSCP to create the files direct in the JFFS folder, worked for me when things didn't go to plan.
 
Could be a line end problem with the script.

Also, try cru with the complete path.


Sent from my iPhone using Tapatalk
 
@Martineau: JFFS is ACTIVE as per the example screenshot.
I will add statements to the files later. Please find my current files attached.

@GoNz0: Never used WinSCP before. Maybe I will have some time at the weekend to give it a try.

@lancer73: Could you please give me the whole command. I am sorry I am not an experienced linux user. it is more ... monkey see, monkey do ...
 

Attachments

  • User-Scripts.zip
    1.6 KB · Views: 173
@Martineau: JFFS is ACTIVE as per the example screenshot.
I will add statements to the files later. Please find my current files attached.

@GoNz0: Never used WinSCP before. Maybe I will have some time at the weekend to give it a try.

@lancer73: Could you please give me the whole command. I am sorry I am not an experienced linux user. it is more ... monkey see, monkey do ...

Make sure the first line of ALL your scripts is ALWAYS:

Code:
#!/bin/sh


Regards,
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top