Merge pull request #37 from vexxhost/systemd-service-file

Add systemd service file
diff --git a/etc/staffeln/staffeln.conf b/etc/staffeln/staffeln.conf
index dd016e5..19a214a 100644
--- a/etc/staffeln/staffeln.conf
+++ b/etc/staffeln/staffeln.conf
@@ -20,9 +20,14 @@
 # retry_interval = 10
 
 [api]
-; host = 0.0.0.0
-; port = 8808
+# host = 0.0.0.0
+# port = 8808
 # enabled_ssl = false
 # ca_file = <None>
 # ssl_cert_file = <None>
 # ssl_key_file = <None>
+
+[notification]
+# receiver = reciever@gmail.com
+# sender_email = sender@vexxhost.com
+# smtp_server_domain = localhost
\ No newline at end of file
diff --git a/etc/systemd/staffeln-api.service b/etc/systemd/staffeln-api.service
new file mode 100644
index 0000000..45005ec
--- /dev/null
+++ b/etc/systemd/staffeln-api.service
@@ -0,0 +1,33 @@
+[Unit]
+Description = staffeln api  service
+After = cinder-backup.service
+After = syslog.target
+
+[Service]
+Type = simple
+User = cgm
+Group = cgm
+ExecStart = /home/cgm/cgm/bin/staffeln-api
+ExecReload = /bin/kill -HUP $MAINPID
+# Give a reasonable amount of time for the server to start up/shut down
+TimeoutSec = 120
+Restart = on-failure
+RestartSec = 2
+# This creates a specific slice which all services will operate from
+#  The accounting options give us the ability to see resource usage through
+#  the `systemd-cgtop` command.
+Slice = staffeln.slice
+# Set Accounting
+CPUAccounting = True
+BlockIOAccounting = True
+MemoryAccounting = True
+TasksAccounting = True
+# Set Sandboxing
+PrivateTmp = False
+PrivateDevices = False
+PrivateNetwork = False
+PrivateUsers = False
+Environment = PATH=/home/cgm/cgm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+
+[Install]
+WantedBy = multi-user.target
diff --git a/etc/systemd/staffeln-conductor.service b/etc/systemd/staffeln-conductor.service
new file mode 100644
index 0000000..3bd78d6
--- /dev/null
+++ b/etc/systemd/staffeln-conductor.service
@@ -0,0 +1,34 @@
+[Unit]
+Description = staffeln conductor  service
+After = cinder-backup.service
+After = syslog.target
+
+[Service]
+Type = simple
+User = cgm
+Group = cgm
+ExecStart = /home/cgm/cgm/bin/staffeln-conductor
+EnvironmentFile=/home/cgm/openrc
+ExecReload = /bin/kill -HUP $MAINPID
+# Give a reasonable amount of time for the server to start up/shut down
+TimeoutSec = 120
+Restart = on-failure
+RestartSec = 2
+# This creates a specific slice which all services will operate from
+#  The accounting options give us the ability to see resource usage through
+#  the `systemd-cgtop` command.
+Slice = staffeln.slice
+# Set Accounting
+CPUAccounting = True
+BlockIOAccounting = True
+MemoryAccounting = True
+TasksAccounting = True
+# Set Sandboxing
+PrivateTmp = False
+PrivateDevices = False
+PrivateNetwork = False
+PrivateUsers = False
+Environment = PATH=/home/cgm/cgm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+
+[Install]
+WantedBy = multi-user.target