osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41862?usp=email )


Change subject: bts: testenv: don't respawn if sched_rr fails
......................................................................

bts: testenv: don't respawn if sched_rr fails

Don't respawning over and over again if osmo-bts-trx fails to start up
because the user isn't allowed to set the rtpriority. Show instructions
for fixing it instead.

Change-Id: I7bc1414f95e4a54a40eb7c6f7b3d6c83ce3500c6
---
A bts/run_osmo_bts_trx.sh
M bts/testenv_generic.cfg
M bts/testenv_hopping.cfg
3 files changed, 19 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/62/41862/1

diff --git a/bts/run_osmo_bts_trx.sh b/bts/run_osmo_bts_trx.sh
new file mode 100755
index 0000000..68ade88
--- /dev/null
+++ b/bts/run_osmo_bts_trx.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+osmo-bts-trx -c osmo-bts.cfg
+EXIT_CODE=$?
+
+if [ $EXIT_CODE != 0 ] && grep -q "SCHED_RR.*Operation not permitted" bts.log; 
then
+       echo
+       echo "===================================================="
+       echo "Allow your user to set rtprio, logout and try again:"
+       echo "$ echo '$USER - rtprio 30' | sudo tee 
'/etc/security/limits.d/${USER}_allow-rtprio.conf'"
+       echo "===================================================="
+       echo
+       exit 128  # Don't respawn
+fi
+
+exit $EXIT_CODE
diff --git a/bts/testenv_generic.cfg b/bts/testenv_generic.cfg
index e04f89c..8703716 100644
--- a/bts/testenv_generic.cfg
+++ b/bts/testenv_generic.cfg
@@ -20,8 +20,8 @@
 package=osmocom-bb-trxcon

 [bts]
-program=respawn.sh osmo-bts-trx
+program=respawn.sh run_osmo_bts_trx.sh
 make=osmo-bts
 package=osmo-bts
-copy=osmo-bts.cfg
+copy=osmo-bts.cfg run_osmo_bts_trx.sh
 vty_port=4241
diff --git a/bts/testenv_hopping.cfg b/bts/testenv_hopping.cfg
index 9426457..d1ff4e9 100644
--- a/bts/testenv_hopping.cfg
+++ b/bts/testenv_hopping.cfg
@@ -23,8 +23,8 @@
 package=osmocom-bb-trxcon

 [bts]
-program=respawn.sh osmo-bts-trx
+program=respawn.sh run_osmo_bts_trx.sh
 make=osmo-bts
 package=osmo-bts
-copy=osmo-bts.cfg
+copy=osmo-bts.cfg run_osmo_bts_trx.sh
 vty_port=4241

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41862?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I7bc1414f95e4a54a40eb7c6f7b3d6c83ce3500c6
Gerrit-Change-Number: 41862
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>

Reply via email to