Add systemd script for PLC.
Marco Yuen [Fri, 2 Mar 2012 14:58:42 +0000 (09:58 -0500)]
myplc.spec
plc.service [new file with mode: 0644]

index 1c72870..f655b87 100644 (file)
@@ -114,6 +114,7 @@ chmod 755 ${RPM_BUILD_ROOT}/usr/bin/*
 # Install initscript 
 echo "* Installing plc initscript"
 install -D -m 755 plc.init ${RPM_BUILD_ROOT}/etc/init.d/plc
+install -D -m 644 plc.service ${RPM_BUILD_ROOT}/lib/systemd/system/plc.service
 
 # Install initscripts
 echo "* Installing plc.d initscripts"
@@ -240,6 +241,7 @@ fi
 /usr/bin/plc-orphan-accounts.py*
 /usr/bin/spot-aliens.py*
 /usr/bin/spot-dup-accounts.sh
+/lib/systemd/system/plc.service
 
 %files config
 %defattr(-,root,root,-)
diff --git a/plc.service b/plc.service
new file mode 100644 (file)
index 0000000..59f7391
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=PLC Service
+After=syslog.target network.target
+
+[Service]
+Type=forking
+ExecStart=/etc/init.d/plc start
+ExecStop=/etc/init.d/plc stop
+ExecReload=/etc/init.d/plc reload
+
+[Install]
+WantedBy=multi-user.target