"services-start" starts too early or I put the file at wrong file?

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

chncar

Occasional Visitor
I’m now using RT-AC68U with Merlin LTS fork 34E3j9527. And the DNS over LTS enabled.


I added bellowed command in services-start to connect IP address and the MAC.


Arp -s 192.168.x.x AA:BB:CC:DD:DE


It doesn’t work. The file is executed but nothing happened, IP is not connected with the MAC


I added 25s delay in the file and it works.


According to merlin wiki, the file services-start shall be executed after all system services.


Is this a bug or I put the command in wrong file?
 

Xentrk

Part of the Furniture
I’m now using RT-AC68U with Merlin LTS fork 34E3j9527. And the DNS over LTS enabled.


I added bellowed command in services-start to connect IP address and the MAC.


Arp -s 192.168.x.x AA:BB:CC:DD:DE


It doesn’t work. The file is executed but nothing happened, IP is not connected with the MAC


I added 25s delay in the file and it works.


According to merlin wiki, the file services-start shall be executed after all system services.


Is this a bug or I put the command in wrong file?
Make sure script is executable. If not, type chmod 755 services-start

First line must be a shebang: #!/bin/sh

The arp command should be all lower case. Try running the services-start from the command line to see if it works without errors e.g. sh services.start

@[email protected] has a good suggestion to add a system log entry at the script start and script end.

logger -t "($(basename "$0"))" $$ "Script Starting"

logger -t "($(basename "$0"))" $$ "Script Ending"
 

RMerlin

Asuswrt-Merlin dev
Services-start runs fairly early, and starts a group of services, but not all of them. Quite a few services are tied to events rather than started by this section of the code.
 

john9527

Part of the Furniture
I don't know whether the wiki for @RMerlin's build is fully applicable on @john9527's LTS fork.
Should be the same on my fork. Not sure it's applicable in this case, but in the 'early' running scripts, init-start and services-start, you should always include the path in the command as the environment may not be fully set yet...i.e. /sbin/arp

Also, it's arp, not Arp (case matters in linux)
 

chncar

Occasional Visitor
Thanks for all your replies.

Actually my services-start file contains command "arp -s IP MAC" now works fine. I just feel strange why I have to put 25s before the command to make it work.

I tried full set command format like "/sbin/arp -s IP MAC" , but I still need to add delays before that command to make it work.

I think Rmerlin is correct that services-start runs after most of system services but not all of them.
 

CooCooCaChoo

Senior Member
Might be because the interface hasn't been brought up yet. I have a script that changes the cwnd that, when executed without a sleep command, will fail because of that. So you might have the inject the 25s sleep command right before your command to give it time for the router to bring up that interface.
 

Similar threads

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