[MERGED] osmo-bts[master]: Copy sysmobts.service to osmo-bts-sysmo

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Thu Jun 22 10:50:01 UTC 2017


Max has submitted this change and it was merged.

Change subject: Copy sysmobts.service to osmo-bts-sysmo
......................................................................


Copy sysmobts.service to osmo-bts-sysmo

This way the name of systemd service file will match the name of the
binary similar to lc15. Add aliases so the user can use both old and new
names regardless of which file is installed. Once the corresponding
changes to OE recipes are applied old file can be removed.

Based on work by Pau Espin Pedrol <pespin at sysmocom.de>

Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5
---
M Makefile.am
A contrib/osmo-bts-sysmo.service
M contrib/sysmobts.service
M src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c
M src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c
5 files changed, 28 insertions(+), 7 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified

Objections:
  Neels Hofmeyr: I would prefer this is not merged as is



diff --git a/Makefile.am b/Makefile.am
index 9a5e26f..5598c4a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@
 
 # package the contrib and doc
 EXTRA_DIST = \
-	contrib/dump_docs.py contrib/screenrc-l1fwd contrib/sysmobts.service \
+	contrib/dump_docs.py contrib/screenrc-l1fwd contrib/osmo-bts-sysmo.service \
 	contrib/l1fwd.init contrib/screenrc-sysmobts contrib/respawn.sh \
 	contrib/sysmobts.init contrib/sysmobts-calib/Makefile \
 	contrib/sysmobts-calib/sysmobts-calib.c \
diff --git a/contrib/osmo-bts-sysmo.service b/contrib/osmo-bts-sysmo.service
new file mode 100644
index 0000000..bbb2bef
--- /dev/null
+++ b/contrib/osmo-bts-sysmo.service
@@ -0,0 +1,20 @@
+[Unit]
+Description=sysmocom sysmoBTS
+
+[Service]
+Type=simple
+ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
+ExecStart=/usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts.cfg -M
+ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
+ExecStopPost=/bin/sh -c 'cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; sleep 3s; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0; sleep 1s'
+Restart=always
+RestartSec=2
+RestartPreventExitStatus=1
+
+# The msg queues must be read fast enough
+CPUSchedulingPolicy=rr
+CPUSchedulingPriority=1
+
+[Install]
+WantedBy=multi-user.target
+Alias=sysmobts.service
diff --git a/contrib/sysmobts.service b/contrib/sysmobts.service
index e07a3db..64e0127 100644
--- a/contrib/sysmobts.service
+++ b/contrib/sysmobts.service
@@ -17,3 +17,4 @@
 
 [Install]
 WantedBy=multi-user.target
+Alias=osmo-bts-sysmo.service
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c
index f01fd14..1be56ac 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c
@@ -116,7 +116,7 @@
 		 * and used SIGCHLD/waitpid to pick up the dead processes
 		 * without invoking shell.
 		 */
-		system("/bin/systemctl start sysmobts.service");
+		system("/bin/systemctl start osmo-bts-sysmo");
 	}
 }
 
@@ -157,7 +157,7 @@
 		 * and used SIGCHLD/waitpid to pick up the dead processes
 		 * without invoking shell.
 		 */
-		system("/bin/systemctl stop sysmobts.service");
+		system("/bin/systemctl stop osmo-bts-sysmo");
 	}
 }
 
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c
index 3020d90..b49f282 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c
@@ -284,7 +284,7 @@
 
 DEFUN(cfg_action_bts_srv_on, cfg_action_bts_srv_on_cmd,
 	"bts-service-on",
-	"Start the systemd sysmobts.service\n")
+	"Start the systemd osmo-bts-sysmo.service\n")
 {
 	int *action = vty->index;
 	*action |= TEMP_ACT_NORM_BTS_SRV_ON;
@@ -293,7 +293,7 @@
 
 DEFUN(cfg_no_action_bts_srv_on, cfg_no_action_bts_srv_on_cmd,
 	"no bts-service-on",
-	NO_STR "Start the systemd sysmobts.service\n")
+	NO_STR "Start the systemd osmo-bts-sysmo.service\n")
 {
 	int *action = vty->index;
 	*action &= ~TEMP_ACT_NORM_BTS_SRV_ON;
@@ -338,7 +338,7 @@
 
 DEFUN(cfg_action_bts_srv_off, cfg_action_bts_srv_off_cmd,
 	"bts-service-off",
-	"Stop the systemd sysmobts.service\n")
+	"Stop the systemd osmo-bts-sysmo.service\n")
 {
 	int *action = vty->index;
 	*action |= TEMP_ACT_BTS_SRV_OFF;
@@ -347,7 +347,7 @@
 
 DEFUN(cfg_no_action_bts_srv_off, cfg_no_action_bts_srv_off_cmd,
 	"no bts-service-off",
-	NO_STR "Stop the systemd sysmobts.service\n")
+	NO_STR "Stop the systemd osmo-bts-sysmo.service\n")
 {
 	int *action = vty->index;
 	*action &= ~TEMP_ACT_BTS_SRV_OFF;

-- 
To view, visit https://gerrit.osmocom.org/2916
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list