mooli tayer has uploaded a new change for review.

Change subject: packaging: ovirt-engine systemd
......................................................................

packaging: ovirt-engine systemd

configure systemd to create a pid file for ovirt-engine service.
This gives same behavior as ovirt-engine sysv services.
This change required removing user= and group= from systemd
file for only root can create the pid file in /var/run.

In order to maintain the the process owner we use runuser,
exactly like it is used by our sysv service
(see ovirt-engine.sysv and /etc/rc.d/init.d/functions@daemon)

Change-Id: Id239a856d247d6dda3a4ed4c212599244793bc7d
Signed-off-by: Mooli Tayer <[email protected]>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=743660
---
M packaging/services/ovirt-engine/ovirt-engine.systemd.in
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/62/18862/1

diff --git a/packaging/services/ovirt-engine/ovirt-engine.systemd.in 
b/packaging/services/ovirt-engine/ovirt-engine.systemd.in
index 978bc91..e3fb92a 100644
--- a/packaging/services/ovirt-engine/ovirt-engine.systemd.in
+++ b/packaging/services/ovirt-engine/ovirt-engine.systemd.in
@@ -4,11 +4,13 @@
 
 [Service]
 Type=simple
-User=@ENGINE_USER@
-Group=@ENGINE_GROUP@
 LimitNOFILE=65535
-ExecStart=@ENGINE_USR@/services/ovirt-engine/ovirt-engine.py --redirect-output 
$EXTRA_ARGS start
+ExecStartPre=/bin/touch /var/run/ovirt-engine.pid
+ExecStartPre=/bin/chown @ENGINE_USER@ /var/run/ovirt-engine.pid
+ExecStart=/usr/sbin/runuser -s /bin/bash ovirt -c 
"@ENGINE_USR@/services/ovirt-engine/ovirt-engine.py --redirect-output 
--pidfile=/var/run/ovirt-engine.pid $EXTRA_ARGS start"
+ExecStopPost=/usr/bin/rm -f /var/run/ovirt-engine.pid
 EnvironmentFile=-/etc/sysconfig/ovirt-engine
+PidFile=/var/run/ovirt-engine.pid
 
 [Install]
 WantedBy=multi-user.target


-- 
To view, visit http://gerrit.ovirt.org/18862
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id239a856d247d6dda3a4ed4c212599244793bc7d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to