aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/systemd')
-rw-r--r--contrib/systemd/Makefile.am18
-rw-r--r--contrib/systemd/lc15bts-mgr.service29
-rw-r--r--contrib/systemd/oc2gbts-mgr.service29
-rw-r--r--contrib/systemd/osmo-bts-lc15.service21
-rw-r--r--contrib/systemd/osmo-bts-oc2g.service21
-rw-r--r--contrib/systemd/osmo-bts-sysmo.service21
-rw-r--r--contrib/systemd/osmo-bts-trx.service15
-rw-r--r--contrib/systemd/osmo-bts-virtual.service15
-rw-r--r--contrib/systemd/sysmobts-mgr.service12
9 files changed, 181 insertions, 0 deletions
diff --git a/contrib/systemd/Makefile.am b/contrib/systemd/Makefile.am
new file mode 100644
index 00000000..16463087
--- /dev/null
+++ b/contrib/systemd/Makefile.am
@@ -0,0 +1,18 @@
+if HAVE_SYSTEMD
+SYSTEMD_SERVICES = osmo-bts-virtual.service
+
+if ENABLE_SYSMOBTS
+SYSTEMD_SERVICES += osmo-bts-sysmo.service sysmobts-mgr.service
+endif
+
+if ENABLE_TRX
+SYSTEMD_SERVICES += osmo-bts-trx.service
+endif
+
+if ENABLE_LC15BTS
+SYSTEMD_SERVICES += osmo-bts-lc15.service lc15bts-mgr.service
+endif
+
+EXTRA_DIST = $(SYSTEMD_SERVICES)
+systemdsystemunit_DATA = $(SYSTEMD_SERVICES)
+endif # HAVE_SYSTEMD
diff --git a/contrib/systemd/lc15bts-mgr.service b/contrib/systemd/lc15bts-mgr.service
new file mode 100644
index 00000000..bf788e61
--- /dev/null
+++ b/contrib/systemd/lc15bts-mgr.service
@@ -0,0 +1,29 @@
+[Unit]
+Description=osmo-bts manager for LC15 / sysmoBTS 2100
+After=lc15-sysdev-remap.service
+Wants=lc15-sysdev-remap.service
+
+[Service]
+Type=simple
+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
diff --git a/contrib/systemd/oc2gbts-mgr.service b/contrib/systemd/oc2gbts-mgr.service
new file mode 100644
index 00000000..ed915b33
--- /dev/null
+++ b/contrib/systemd/oc2gbts-mgr.service
@@ -0,0 +1,29 @@
+[Unit]
+Description=osmo-bts manager for OC-2G
+After=oc2g-sysdev-remap.service
+Wants=oc2g-sysdev-remap.service
+
+[Service]
+Type=simple
+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/oc2gbts-mgr || mkdir -p /mnt/storage/var/run/oc2gbts-mgr ; test -d /var/run/oc2gbts-mgr || ln -sf /mnt/storage/var/run/oc2gbts-mgr/ /var/run'
+# Make sure BTS operation hour exist
+ExecStartPre=/bin/sh -c 'test -f /mnt/storage/var/run/oc2gbts-mgr/hours-running || echo 0 > /mnt/storage/var/run/oc2gbts-mgr/hours-running'
+# Shutdown all PA correctly
+ExecStartPre=/bin/sh -c 'echo disabled > /var/oc2g/pa-state/pa0/state;'
+#ExecStartPre=/bin/sh -c 'echo 0 > /var/oc2g/pa-supply/max_microvolts; echo 0 > /var/oc2g/pa-supply/min_microvolts'
+
+ExecStart=/usr/bin/oc2gbts-mgr -s -c /etc/osmocom/oc2gbts-mgr.cfg
+
+# Shutdown all PA correctly
+ExecStopPost=/bin/sh -c 'echo disabled > /var/oc2g/pa-state/pa0/state;'
+#ExecStopPost=/bin/sh -c 'echo 0 > /var/oc2g/pa-supply/max_microvolts; echo 0 > /var/oc2g/pa-supply/min_microvolts'
+
+[Install]
+WantedBy=multi-user.target
+Alias=osmo-bts-mgr.service
diff --git a/contrib/systemd/osmo-bts-lc15.service b/contrib/systemd/osmo-bts-lc15.service
new file mode 100644
index 00000000..90e7fc29
--- /dev/null
+++ b/contrib/systemd/osmo-bts-lc15.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=osmo-bts for LC15 / sysmoBTS 2100
+
+[Service]
+Type=simple
+ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
+ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr1/brightness'
+ExecStart=/usr/bin/osmo-bts-lc15 -t 2 -s -c /etc/osmocom/osmo-bts-lc15.cfg -M
+ExecStopPost=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
+ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness'
+Restart=always
+RestartSec=2
+RestartPreventExitStatus=1
+
+# The msg queues must be read fast enough
+CPUSchedulingPolicy=rr
+CPUSchedulingPriority=1
+
+[Install]
+WantedBy=multi-user.target
+Alias=osmo-bts.service
diff --git a/contrib/systemd/osmo-bts-oc2g.service b/contrib/systemd/osmo-bts-oc2g.service
new file mode 100644
index 00000000..2f2d8378
--- /dev/null
+++ b/contrib/systemd/osmo-bts-oc2g.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=osmo-bts for OC-2G
+
+[Service]
+Type=simple
+ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
+ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr1/brightness'
+ExecStart=/usr/bin/osmo-bts-oc2g -s -c /etc/osmocom/osmo-bts.cfg -M
+ExecStopPost=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
+ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness'
+Restart=always
+RestartSec=2
+RestartPreventExitStatus=1
+
+# The msg queues must be read fast enough
+CPUSchedulingPolicy=rr
+CPUSchedulingPriority=1
+
+[Install]
+WantedBy=multi-user.target
+Alias=osmo-bts.service
diff --git a/contrib/systemd/osmo-bts-sysmo.service b/contrib/systemd/osmo-bts-sysmo.service
new file mode 100644
index 00000000..92558172
--- /dev/null
+++ b/contrib/systemd/osmo-bts-sysmo.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=osmo-bts for 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-sysmo.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
+Alias=osmo-bts.service
diff --git a/contrib/systemd/osmo-bts-trx.service b/contrib/systemd/osmo-bts-trx.service
new file mode 100644
index 00000000..97c2b070
--- /dev/null
+++ b/contrib/systemd/osmo-bts-trx.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Osmocom osmo-bts for osmo-trx
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/osmo-bts-trx -s -c /etc/osmocom/osmo-bts-trx.cfg
+Restart=always
+RestartSec=2
+
+# Let it process messages quickly enough
+CPUSchedulingPolicy=rr
+CPUSchedulingPriority=1
+
+[Install]
+WantedBy=multi-user.target
diff --git a/contrib/systemd/osmo-bts-virtual.service b/contrib/systemd/osmo-bts-virtual.service
new file mode 100644
index 00000000..16332669
--- /dev/null
+++ b/contrib/systemd/osmo-bts-virtual.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Osmocom GSM BTS for virtual Um layer based on GSMTAP/UDP
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/osmo-bts-virtual -s -c /etc/osmocom/osmo-bts-virtual.cfg
+Restart=always
+RestartSec=2
+
+# Let it process messages quickly enough
+CPUSchedulingPolicy=rr
+CPUSchedulingPriority=1
+
+[Install]
+WantedBy=multi-user.target
diff --git a/contrib/systemd/sysmobts-mgr.service b/contrib/systemd/sysmobts-mgr.service
new file mode 100644
index 00000000..4346991d
--- /dev/null
+++ b/contrib/systemd/sysmobts-mgr.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=osmo-bts manager for sysmoBTS
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/sysmobts-mgr -ns -c /etc/osmocom/sysmobts-mgr.cfg
+Restart=always
+RestartSec=2
+
+[Install]
+WantedBy=multi-user.target
+Alias=osmo-bts-mgr.service