From 89adc0ba977c625cdb0fec8dc40c96c19d175cce Mon Sep 17 00:00:00 2001
From: Alexander Soderqvist <alexander.soderqvist@esss.se>
Date: Thu, 25 May 2017 11:39:15 +0200
Subject: [PATCH] fixed systemd service specification

---
 misc/README           | 5 ++++-
 misc/emu-lebt.service | 7 +++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/misc/README b/misc/README
index 25f3519..f588100 100644
--- a/misc/README
+++ b/misc/README
@@ -7,5 +7,8 @@ The work around is to run the ioc as root user. A special systemd service has be
 
 The systemd service specification should be placed in the root file system under /etc/systemd/system/
 
-To reload systemd services run: systemctl daemon-reload
+To enable the service from boot, specify path to your rootfs e.g.
+systemctl --root=/export/nfsroots/ifc1210/rootfs-NEW/ enable emu-lebt
+
+To reload systemd services and start on already running system: systemctl daemon-reload
 To start the ioc: systemctl start emu-lebt
diff --git a/misc/emu-lebt.service b/misc/emu-lebt.service
index f0e1b27..2b8d377 100644
--- a/misc/emu-lebt.service
+++ b/misc/emu-lebt.service
@@ -2,9 +2,12 @@
 Description=IOC: emu-lebt
 After=rc-local.service
  
+[Install]
+WantedBy=multi-user.target
+ 
 [Service]
 User=root
- 
+
 # Only execute IOC if st.cmd exists
 AssertPathExists=/opt/startup/ioc/VME_EMU-iamspecial/emu/st.cmd
  
@@ -16,4 +19,4 @@ ExecStartPre=/bin/chown -R ioc:ioc /var/run/procServ/emu
 EnvironmentFile=/opt/startup/ioc/VME_EMU-iamspecial/emu/env.sh
  
 # Run procServ with user ioc
-ExecStart=/usr/bin/procServ --allow -f -L /var/log/procServ/out-emu -i ^C^D -c /var/run/procServ/%i ${PROCSERV_PORT} ${EPICS_MODULES_PATH}/environment/${ENVIRONMENT_VERSION}/${BASE}/bin/${EPICS_HOST_ARCH}/iocsh /opt/startup/ioc/VME_EMU-iamspecial/%i/st.cmd -n emu
+ExecStart=/usr/bin/procServ --allow -f -L /var/log/procServ/out-emu -i ^C^D -c /var/run/procServ/emu ${PROCSERV_PORT} ${EPICS_MODULES_PATH}/environment/${ENVIRONMENT_VERSION}/${BASE}/bin/${EPICS_HOST_ARCH}/iocsh /opt/startup/ioc/VME_EMU-iamspecial/emu/st.cmd -n emu
-- 
GitLab