summarylogtreecommitdiffstats
path: root/opennebula.service
diff options
context:
space:
mode:
authorsulaweyo2017-08-24 17:54:02 +0200
committersulaweyo2017-08-24 17:54:02 +0200
commitc0355bdaf49393deef8d4586a88cfdd276bba67d (patch)
tree62b1379c8ff4efc0fc7b599da2df2870d6cafac7 /opennebula.service
parent936ed6835c0bd4124a34ebf32cfd57a585d4fef5 (diff)
downloadaur-c0355bdaf49393deef8d4586a88cfdd276bba67d.tar.gz
Service units are now a lot closer to upstream
Logrotate and tmpfiles taken over from upstream
Diffstat (limited to 'opennebula.service')
-rw-r--r--opennebula.service22
1 files changed, 14 insertions, 8 deletions
diff --git a/opennebula.service b/opennebula.service
index f32f691146f7..1c20bbe7304f 100644
--- a/opennebula.service
+++ b/opennebula.service
@@ -1,18 +1,24 @@
[Unit]
Description=OpenNebula management
-After=network.target local-fs.target remote-fs.target mysqld.service
+After=syslog.target network.target local-fs.target remote-fs.target mysqld.service
+Before=opennebula-scheduler.service
+BindTo=opennebula-scheduler.service
[Service]
User=oneadmin
Group=cloud
-Type=forking
+Type=simple
PermissionsStartOnly=true
-ExecStartPre=/usr/bin/mkdir -p /var/run/one
-ExecStartPre=/usr/bin/mkdir -p /var/lock/one
-ExecStartPre=/usr/bin/chown -R oneadmin:cloud /var/run/one
-ExecStartPre=/usr/bin/chown -R oneadmin:cloud /var/lock/one
-ExecStart=/usr/bin/one start
-ExecStop=/usr/bin/one stop
+
+# Start daemon in forground mode, when starting as forking process the
+# daemon shuts down without obvious reason.
+ExecStart=/usr/bin/oned -f
+# Log file location must exist
+ExecStartPre=/bin/mkdir -p /var/log/one
+ExecStartPre=/bin/chown oneadmin:cloud /var/log/one
+ExecStartPre=/usr/bin/logrotate -s /tmp/logrotate.state -f /etc/logrotate.d/opennebula
+ExecStop=/bin/kill -TERM $MAINPID
+PIDFile=/var/run/one/oned.pid
Restart=on-abnormal
[Install]