1

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 ?

Jacobm001
11.9k7 gold badges48 silver badges58 bronze badges
asked Mar 1, 2016 at 17:14
11
  • cannot add tmux tag since don't have enough Reputations Commented Mar 1, 2016 at 17:16
  • Have you checked that the command works without tmux from rc.local? Commented Mar 1, 2016 at 17:24
  • @Shan-Desai: I have added the tag for you. Commented Mar 1, 2016 at 17:26
  • @Craig Hi will have a look at it but it should work because I have another stand alone bash script in rc.local that executes perfectly Commented Mar 1, 2016 at 17:52
  • 1
    I doubt it. The man page says that alfred runs as daemon. If that is the case it is probably forking and exiting immediately. When that happens the tmux window is closed. Commented Mar 1, 2016 at 20:20

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.