What's new

Asuswrt-Merlin 384.6 doesn't start nginx

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

Lucian Bornaz

New Around Here
Hi all,
I got An ASUS AC86U and I installed Asuswrt-Merlin 384.6. Later I decided to install nginx and all went fine except nginx doesn't get started when I reboot the router.
The script S80nginx in init.d folder gets executed (I added logging to it) but for some reason nginx doesn't start.
Manually running S80nginx from an SSH session, or just invoking "nginx" at command prompt start nginx just fine.
Is there any other way to start an app/service or script at boot time?

Thanks!
 
The documentation says that one should use "/jffs/services-start" to start any service/app after all the other services have been started.
"/jffs/services-start" runs "/opt/etc/init.d/rc.unslung" which in turn executes all executable scripts in "/opt/etc/init.d/" folder which names starts with "Sxx" (xx is a number used to run scripts in a specific order).
On my router, there is "/opt/etc/init.d/S80nginx" script file which gets executed on start up but, for some reason, nginx doesn't get started. When I execute the same script from command prompt nginx starts as expected.
Do you know any other way to start an app/service or script at boot time? Or is it anything I'm missing here?
 
- Not sure how you edited the nginx script...but make sure you didn't accidentally introduce dos line endings....run dos2unix on the file.
- Speculation....you may need to have the internet connection established to get it to start, which may not have occurred when services-start runs. Try adding a delay to the nginx start. If that works, you can get more sophisticated and use a wait loop waiting for the internet to come up.
 
- Not sure how you edited the nginx script...but make sure you didn't accidentally introduce dos line endings....run dos2unix on the file.
- Speculation....you may need to have the internet connection established to get it to start, which may not have occurred when services-start runs. Try adding a delay to the nginx start. If that works, you can get more sophisticated and use a wait loop waiting for the internet to come up.
I used vi to edit the file from putty session, but i can only guess that if the file was be corrupt it wouldn't execute from command prompt.
Adding a delay in "/opt/etc/init.d/S80nginx" script might work but i find difficult to believe that this is the correct solution. Especially when "/opt/etc/init.d/S80nginx" script has been created when nginx was installed. A solution worth to give a try though.
Thanks!
 
Adding a delay in "/opt/etc/init.d/S80nginx" script might work but i find difficult to believe that this is the correct solution. Especially when "/opt/etc/init.d/S80nginx" script has been created when nginx was installed. A solution worth to give a try though.
School of hard knocks here....I never take things like that for granted. Especially when you are working with an embedded linux that's designed to support a router....not generic apps.
 
Why not create an init-start in /jffs/scripts/ (https://github.com/RMerl/asuswrt-merlin/wiki/User-scripts) and put the start there? At least to try and see if it works.. according to the wiki that is the earliest things can be added.
I’ve tried to add a sleep in the script to wait a bit before running nginx but it didn’t help.
At this point I’m thinking that I should run nginx at a later time rather then earlier.
But I will give it a try out of curiosity.
Thanks again.
 
init-start is way too early in the boot process. The USB disks aren't mounted yet at that point, for instance.
 
@Lucian Bornaz I'm interested in running nginx too. Have you managed to solve your issue and would you mind sharing your configuration?
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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