I am running two mesh-networking daemons, namely A.L.F.R.E.D. and BATADV-VIS on Raspberry Pi-2. BATADV-VIS is dependent on ALFRED hence I am using tmux to run them as a complete session.
I have created a bash file which I call from the /etc/rc.local. The details are as follows:
# !/bin/sh
tmux new-session -d -s piSession
tmux new-window -d -n 'alfredHere' -t piSession:1 'alfred --interface wlan0'
# the line above doesn't get executed when called from /etc/rc.local
tmux new-window -d -n 'batvisHere' -t piSession:2 'batadv-vis -s'
the above bash file is in /home/pi/ folder
When I do the following tmux ls I only get 2 Windows where infact I am expecting 3 (1 x alfred running + 1 x batadv-vis running + 1 normal)
when I do the following tmux attach I do not see the alfred --interface wlan0 at all and the only other window open (except a common terminal session) is running batadv-vis -s.
Why is the line getting skipped or not being executed?
Observation
when I run the script from the /home/pi/ folder as following:
bash /home/pi/path/myScript.sh
tmux ls
It shows 3 Windows and then everything works perfectly. Why isn't it triggering the 2nd line in case of a call from /etc/rc.local ?
tmuxtag since don't have enough Reputations – Shan-Desai Mar 01 '16 at 17:16rc.localthat executes perfectly – Shan-Desai Mar 01 '16 at 17:52waitafter opening a session and starting a window can help? @Craig – Shan-Desai Mar 01 '16 at 18:16; readto the end of the command and look whether the tmux window is expecting input (and closes on pressing enter) – msrd0 Mar 01 '16 at 20:50tmux set-option -t piSession set-remain-on-exit onThat should prevent the window from closing when the command exits. – Craig Mar 01 '16 at 22:05tmux set-option -t piSession set-remain-on-exit-onas you mentioned now the call works from the/etc/rc.localbut the message reads on the ALFRED window :pane is dead.but running from
– Shan-Desai Mar 02 '16 at 11:20/home/pi/withbashcommand works well again.start-stop-daemontypes and can be run using the following:start-stop-daemon -b --start --exec /usr/local/sbin/alfred -- -i wlan0start-stop-daemon -b --start --exec /usr/local/sbin/batadv-vis -sbut even though I keep them in a bash script and run the same script viarc.localALFRED doesn't execute but batadv-vis does. sadly only way I can trigger it is through and ssh login :(any tips on how to start
– Shan-Desai Mar 03 '16 at 16:24start-stop-daemonon bootup?bin/in the$HOMEfolder and changed the.bashrcscript by setting the path variables as follow:export PATH=$PATH:bin/in both the root and/home/pifolder I still cannot run the Daemons on start up nor withcrontabwith@rebootonly make believe way is I need to
– Shan-Desai Mar 04 '16 at 22:02sshinto the pi and trigger it by myself.