Harald Welte has submitted this change and it was merged.

Change subject: lc15bts-mgr.service: Prepare dirs and sysctls for the process
......................................................................


lc15bts-mgr.service: Prepare dirs and sysctls for the process

Change-Id: I0a0a10ca9498318c48c81fa94faceb2ad4ac1de6
---
M contrib/lc15bts-mgr.service
1 file changed, 18 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/contrib/lc15bts-mgr.service b/contrib/lc15bts-mgr.service
index 5790abe..bf788e6 100644
--- a/contrib/lc15bts-mgr.service
+++ b/contrib/lc15bts-mgr.service
@@ -1,12 +1,29 @@
 [Unit]
 Description=osmo-bts manager for LC15 / sysmoBTS 2100
+After=lc15-sysdev-remap.service
+Wants=lc15-sysdev-remap.service
 
 [Service]
 Type=simple
-ExecStart=/usr/bin/lc15bts-mgr -s -c /etc/osmocom/lc15bts-mgr.cfg
+NotifyAccess=all
+WatchdogSec=21780s
 Restart=always
 RestartSec=2
 
+# Make sure directories and symbolic link exist
+ExecStartPre=/bin/sh -c 'test -d /mnt/storage/var/run/lc15bts-mgr || mkdir -p 
/mnt/storage/var/run/lc15bts-mgr ; test -d /var/run/lc15bts-mgr || ln -sf 
/mnt/storage/var/run/lc15bts-mgr/ /var/run'
+# Make sure BTS operation hour exist
+ExecStartPre=/bin/sh -c 'test -f 
/mnt/storage/var/run/lc15bts-mgr/hours-running || echo 0 > 
/mnt/storage/var/run/lc15bts-mgr/hours-running'
+# Shutdown all PA correctly
+ExecStartPre=/bin/sh -c 'echo disabled > /var/lc15/pa-state/pa0/state; echo 
disabled > /var/lc15/pa-state/pa1/state'
+ExecStartPre=/bin/sh -c 'echo 0 > /var/lc15/pa-supply/max_microvolts; echo 0 > 
/var/lc15/pa-supply/min_microvolts'
+
+ExecStart=/usr/bin/lc15bts-mgr -s -c /etc/osmocom/lc15bts-mgr.cfg
+
+# Shutdown all PA correctly
+ExecStopPost=/bin/sh -c 'echo disabled > /var/lc15/pa-state/pa0/state; echo 
disabled > /var/lc15/pa-state/pa1/state'
+ExecStopPost=/bin/sh -c 'echo 0 > /var/lc15/pa-supply/max_microvolts; echo 0 > 
/var/lc15/pa-supply/min_microvolts'
+
 [Install]
 WantedBy=multi-user.target
 Alias=osmo-bts-mgr.service

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0a0a10ca9498318c48c81fa94faceb2ad4ac1de6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder

Reply via email to