Add service files

Added service files for ADC, CPU, HWTemp and Fan sensors.
Install service files in /lib/systemd/system

Change-Id: I1d87f3f22417051dcd039bb3232906803c2cb891
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a1c80e4..d00d64a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,4 +122,12 @@
     add_dependencies (cpusensor ${EXTERNAL_PACKAGES})
 endif ()
 
+set (
+    SERVICE_FILES
+    ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.adcsensor.service
+    ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.cpusensor.service
+    ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.fansensor.service
+    ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.hwmontempsensor.service
+)
 install (TARGETS fansensor hwmontempsensor cpusensor adcsensor DESTINATION bin)
+install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)
diff --git a/service_files/xyz.openbmc_project.adcsensor.service b/service_files/xyz.openbmc_project.adcsensor.service
new file mode 100644
index 0000000..520d71e
--- /dev/null
+++ b/service_files/xyz.openbmc_project.adcsensor.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Adc Sensor
+StopWhenUnneeded=false
+
+[Service]
+Restart=always
+RestartSec=5
+ExecStart={bindir}/adcsensor
+
+[Install]
+WantedBy=multi-user.target
diff --git a/service_files/xyz.openbmc_project.cpusensor.service b/service_files/xyz.openbmc_project.cpusensor.service
new file mode 100644
index 0000000..bdbadea
--- /dev/null
+++ b/service_files/xyz.openbmc_project.cpusensor.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=CPU Sensor
+StopWhenUnneeded=false
+
+[Service]
+Restart=always
+RestartSec=5
+StartLimitBurst=10
+ExecStart={bindir}/cpusensor
+
+[Install]
+WantedBy=multi-user.target
diff --git a/service_files/xyz.openbmc_project.fansensor.service b/service_files/xyz.openbmc_project.fansensor.service
new file mode 100644
index 0000000..246718a
--- /dev/null
+++ b/service_files/xyz.openbmc_project.fansensor.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Fan Sensor
+StopWhenUnneeded=false
+
+[Service]
+Restart=always
+RestartSec=5
+ExecStart={bindir}/fansensor
+
+[Install]
+WantedBy=multi-user.target
diff --git a/service_files/xyz.openbmc_project.hwmontempsensor.service b/service_files/xyz.openbmc_project.hwmontempsensor.service
new file mode 100644
index 0000000..bb56228
--- /dev/null
+++ b/service_files/xyz.openbmc_project.hwmontempsensor.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Hwmon Temp Sensor
+StopWhenUnneeded=false
+
+[Service]
+Restart=always
+RestartSec=5
+ExecStart={bindir}/hwmontempsensor
+
+[Install]
+WantedBy=multi-user.target