aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-08-07 11:51:19 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-08-07 11:56:11 +0200
commit6fe823a7e1aa350584e60ad1813e3e154bbd003a (patch)
tree538225aaeadddc705278b73664609a273edc3ed2
parentd208132ab90e3314ae5fbd9830bf43c1b3fa1893 (diff)
lc15bts-mgr.service: Prepare dirs and sysctls for the process
-rw-r--r--contrib/lc15bts-mgr.service19
1 files changed, 18 insertions, 1 deletions
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