What's new

services-start not starting

  • 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!

stafli

Occasional Visitor
Hi,
The last few times i've rebooted my router, the "services-start" script hasn't executed. I can manually execute it by the command "sh services-start", but I want it to automatically start.

File and location as in enclosed pic.

I've also noted that I cant execute a script by just typing it's name. I have to add "sh" before the name. Might this be connected to my first problem? As you can see, the shebang is in place and the file is set as executable.

I'm using the same "services-start" as I used to from the beginning - this problem came a few SW-releases ago.

Script.jpg
 
Hi,
The last few times i've rebooted my router, the "services-start" script hasn't executed. I can manually execute it by the command "sh services-start", but I want it to automatically start.

File and location as in enclosed pic.

I've also noted that I cant execute a script by just typing it's name. I have to add "sh" before the name. Might this be connected to my first problem? As you can see, the shebang is in place and the file is set as executable.

I'm using the same "services-start" as I used to from the beginning - this problem came a few SW-releases ago.

View attachment 4087

Linux can be so frustrating at times! :(

So I have deliberately created a single-line script that is ambiguous and one would expect it to always fail, as it is missing the expected mandatory first line '#!/bin/sh' but depending on how you submit a request to execute it will actually run!

Code:
admin@RT-AC56U:/jffs/scripts# cat test7.sh
echo hello

admin@RT-AC56U:/jffs/scripts# test7.sh
-sh: test7.sh: not found

admin@RT-AC56U:/jffs/scripts# sh test7.sh
hello

admin@RT-AC56U:/jffs/scripts# ./test7.sh
hello

So I suggest you delete the first line or preferably recreate the file by hand ensuring you use a Unix compatible editor such as vi/nano or Notepad++ or via a WinSCP connection if using a Windows O/S
 
If you don't specify an absolute (/jffs/scripts/test7.sh) or relative path (./test7.sh), the specified executable is looked up in whatever directories are defined in the shell's $PATH. It can't find it there, so the shell says it couldn't find it. "echo $PATH" if you want to see those.
 
If you don't specify an absolute (/jffs/scripts/test7.sh) or relative path (./test7.sh), the specified executable is looked up in whatever directories are defined in the shell's $PATH. It can't find it there, so the shell says it couldn't find it. "echo $PATH" if you want to see those.

Thanks! I can now execute the script without entering "sh services-start" by entering full path. However, the question why "services-start" doesn't execute at boot remains.
 
are you sure it's the case of services-start not getting executed, versus your mount command actually failed at the time when services-start runs?

the reason being, at the time services-start runs, how do you so sure 192.168.1.10 is already connected and reachable (even if it's hardwired and static DHCP'd)?

also: for SURE you need
#!/bin/sh
as the 1st line.
 
are you sure it's the case of services-start not getting executed, versus your mount command actually failed at the time when services-start runs?

the reason being, at the time services-start runs, how do you so sure 192.168.1.10 is already connected and reachable (even if it's hardwired and static DHCP'd)?

also: for SURE you need
#!/bin/sh
as the 1st line.

Thanks, I actually checked the log, and it says:
"Jan 1 01:00:14 custom script: Running /jffs/scripts/services-start".

However, further down in the log, I see:
"Jul 8 13:17:19 kernel: CIFS VFS: Error connecting to IPv4 socket. Aborting operation".

I tried to put in a "sleep 20" in the line after the "#!/bin/sh", but I got the same result.

Immediately when router has started, I manually telnet it and run the command /jffs/scripts/services-start, and cifs1 gets mounted.
 
Hi,
The last few times i've rebooted my router, the "services-start" script hasn't executed. I can manually execute it by the command "sh services-start", but I want it to automatically start.

File and location as in enclosed pic.

I've also noted that I cant execute a script by just typing it's name. I have to add "sh" before the name. Might this be connected to my first problem? As you can see, the shebang is in place and the file is set as executable.

I'm using the same "services-start" as I used to from the beginning - this problem came a few SW-releases ago.

View attachment 4087

Thanks for your help leading me to a solution - a "sleep 60" after the shebang did the trick!
 
The last few times i've rebooted my router, the "services-start" script hasn't executed.
...
I'm using the same "services-start" as I used to from the beginning - this problem came a few SW-releases ago.
Please check Adimistration > System page to make sure Enable JFFS custom scripts and configs option is turned on. It's a new option, added few releases ago.
 

Similar threads

Sign Up For SNBForums Daily Digest

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