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@sysmocom.de>

Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5
This commit is contained in:
Max 2017-06-14 15:19:06 +02:00
parent d4806db1e5
commit 114293a414
5 changed files with 28 additions and 7 deletions

View File

@ -5,7 +5,7 @@ SUBDIRS = include src tests
# 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 \

View File

@ -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

View File

@ -17,3 +17,4 @@ CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target
Alias=osmo-bts-sysmo.service

View File

@ -116,7 +116,7 @@ static void handle_normal_actions(int actions)
* 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 @@ static void handle_actions(int actions)
* 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");
}
}

View File

@ -284,7 +284,7 @@ DEFUN(cfg_no_action_pa_on, cfg_no_action_pa_on_cmd,
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_action_bts_srv_on, cfg_action_bts_srv_on_cmd,
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_no_action_pa_off, cfg_no_action_pa_off_cmd,
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_action_bts_srv_off, cfg_action_bts_srv_off_cmd,
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;