[SOLVED] Running multiple commands

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
scope2
DD-WRT User


Joined: 12 Jul 2017
Posts: 181

PostPosted: Wed Nov 10, 2021 21:11    Post subject: [SOLVED] Running multiple commands Reply with quote
I've have added a second command to my startup command field, but the first command (highlighted) (which have been running fine for years) does not appear to run any more.



Have I added the second command correctly? Do I need some sort of separator?

root@R7800:~# ps | grep -v "grep" | grep -c "yamon3"
0

After running manually:
root@R7800:/opt/YAMon3# ps | grep -v "grep" | grep -c "yamon3"
1
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Wed Nov 10, 2021 21:44    Post subject: Reply with quote
The general forum is not the best place to ask questions see the second announcement in the top of that forum:
Quote:
STOP!-READ FIRST: This area is NOT for router help! READ!


Furthermore stating buildnumber and router model (probably R7800) is wanted to give optimal support

You say it always worked but was that on your current build or on an earlier build?

It seems you start from /opt presumably from an usb drive/stick?

If so chances are the usb drive is not ready yet when the startup runs.

So as first line try this:
Code:
is-mounted.sh /opt


That runs a script which waits till /opt is ready, alternatively enter:
Code:
sleep 30


I will transfer this thread to a more appropriate forum

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
scope2
DD-WRT User


Joined: 12 Jul 2017
Posts: 181

PostPosted: Wed Nov 10, 2021 21:55    Post subject: Reply with quote
egc wrote:
The general forum is not the best place to ask questions see the second announcement in the top of that forum:
Quote:
STOP!-READ FIRST: This area is NOT for router help! READ!


Furthermore stating buildnumber and router model (probably R7800) is wanted to give optimal support

You say it always worked but was that on your current build or on an earlier build?

It seems you start from /opt presumably from an usb drive/stick?

If so chances are the usb drive is not ready yet when the startup runs.

So as first line try this:
Code:
is-mounted.sh /opt


That runs a script which waits till /opt is ready, alternatively enter:
Code:
sleep 30


I will transfer this thread to a more appropriate forum


Sorry, running Firmware: DD-WRT v3.0-r47618 std (11/05/21) on a R7800, however I dont think that is the issue.

Up till today I was running this command on its own in the startup command, and it was working:

"/opt/YAMon3/startup.sh 10"

I then, today, updated the startup command field to include the vpn-pbr-watchdog script. The watchdog script seems to be running, but the first line in that box (Yamon) is not executed as far as I can see..

So, I now have 2 separate scripts in the startup command field, is that possible, or do I need to add them both into a custom script and only refer that 1 script in the startup command?

So I dont think the issue is related to /opt not being there, etc, as it has always been running.
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1446
Location: Appalachian mountains, USA

PostPosted: Thu Nov 11, 2021 0:01    Post subject: Reply with quote
I have ten times the material in my Startup window than you have in yours, in six different routers. It's just a big script space. Whatever your problem is, it's not about including a little more material.

I can't really guess what interaction between the original line and the rest might be causing you trouble. I have no idea what the first line does, and while the rest looks like a script I've seen in these parts before, I can't read it clearly either: the imgur image won't load for me, so I only see the thumbnail. I'm pretty nearsighted, but that's kind of at my limit on my small-screen phone! As an alternative, this kind of code block
Code:
you do in this way:
[code]your code here
and here
and here...[/code]

Do experiment with @egc's timing idea. He has more dd-wrt experience than the rest of us put together, and if that experience says timing issues often arise in surprising ways during startup, well...

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14126
Location: Texas, USA

PostPosted: Thu Nov 11, 2021 3:16    Post subject: Reply with quote
Not like it has not been stated before to use a sleep command of up to 30 seconds for USB stored scripts. The other option is to save just that one line as a USB script... since it should run on mount...
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
scope2
DD-WRT User


Joined: 12 Jul 2017
Posts: 181

PostPosted: Thu Nov 11, 2021 8:13    Post subject: Reply with quote
SurprisedItWorks wrote:

Do experiment with @egc's timing idea. He has more dd-wrt experience than the rest of us put together, and if that experience says timing issues often arise in surprising ways during startup, well...


Im well aware of @egc's expertise, he has helped me out on a number of issues recently. Smile

I will give the sleep command a go when I get home, it might just be that the upgrade to r47618 (from a fairly old build) the very same day has introduced a delay at mapping the USB drive or something...
scope2
DD-WRT User


Joined: 12 Jul 2017
Posts: 181

PostPosted: Thu Nov 11, 2021 16:09    Post subject: Reply with quote
egc wrote:

It seems you start from /opt presumably from an usb drive/stick?

If so chances are the usb drive is not ready yet when the startup runs.

So as first line try this:
Code:
is-mounted.sh /opt


That runs a script which waits till /opt is ready, alternatively enter:
Code:
sleep 30



A 'sleep 30' appears to have resolved the problem. Smile

Thanks for your help (again).
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Thu Nov 11, 2021 16:25    Post subject: Reply with quote
We are here to help Smile
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum