Change in vdsm[master]: packaging: rename supervdsmServer.py to supervdsmServer and ...

zhshzhou at linux.vnet.ibm.com zhshzhou at linux.vnet.ibm.com
Fri Jul 19 08:51:11 UTC 2013


Zhou Zheng Sheng has uploaded a new change for review.

Change subject: packaging: rename supervdsmServer.py to supervdsmServer and add environment file
......................................................................

packaging: rename supervdsmServer.py to supervdsmServer and add environment file

supervdsm process is started by "python supervdsmServer.pyc". This is a
bit verbose when it is put in the SysV init script and SystemD service
unit. This patch renames supervdsmServer.py to supervdsmServer to enable
the init script start supervdsmServer directly.

In this patch, an environment file is also add for supervdsmd service.

Change-Id: Ifbcfcfb6f22040d038541c79ac4d0e66ac106504
Signed-off-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
---
M vdsm.spec.in
M vdsm/Makefile.am
R vdsm/supervdsmServer
M vdsm/supervdsmd.init.in
M vdsm/supervdsmd.service.in
5 files changed, 8 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/17100/1

diff --git a/vdsm.spec.in b/vdsm.spec.in
index 0af0680..2de2ed8 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -826,7 +826,7 @@
 %{_datadir}/%{vdsm_name}/sourceRoute.py*
 %{_datadir}/%{vdsm_name}/sourceRouteThread.py*
 %{_datadir}/%{vdsm_name}/supervdsm.py*
-%{_datadir}/%{vdsm_name}/supervdsmServer.py*
+%{_datadir}/%{vdsm_name}/supervdsmServer
 %{_datadir}/%{vdsm_name}/vmChannels.py*
 %{_datadir}/%{vdsm_name}/tc.py*
 %{_datadir}/%{vdsm_name}/vdsm
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index eba50f1..ba403da 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -49,7 +49,6 @@
 	sourceRoute.py \
 	sourceRouteThread.py \
 	supervdsm.py \
-	supervdsmServer.py \
 	tc.py \
 	vdsmDebugPlugin.py \
 	vmChannels.py \
@@ -95,6 +94,7 @@
 	get-conf-item \
 	respawn \
 	set-conf-item \
+	supervdsmServer \
 	vdsm \
 	vdsm-restore-net-config \
 	$(NULL)
diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer
similarity index 99%
rename from vdsm/supervdsmServer.py
rename to vdsm/supervdsmServer
old mode 100644
new mode 100755
index 64becaf..318b403
--- a/vdsm/supervdsmServer.py
+++ b/vdsm/supervdsmServer
@@ -1,3 +1,4 @@
+#!/usr/bin/python
 # Copyright 2011 Red Hat, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
diff --git a/vdsm/supervdsmd.init.in b/vdsm/supervdsmd.init.in
index 388e1cb..605ef57 100755
--- a/vdsm/supervdsmd.init.in
+++ b/vdsm/supervdsmd.init.in
@@ -18,12 +18,13 @@
 # Short-Description: init script for the Super VDS management server
 ### END INIT INFO
 
-SUPERVDSM_BIN=@VDSMDIR@/supervdsmServer.pyc
+SUPERVDSM_BIN=@VDSMDIR@/supervdsmServer
 PIDFILE=@VDSMRUNDIR@/supervdsmd.pid
 RESPAWNPIDFILE=@VDSMRUNDIR@/supervdsm_respawn.pid
 SOCKFILE=@VDSMRUNDIR@/svdsm.sock
 prog=supervdsm
 
+[ -f /etc/sysconfig/supervdsmd ] && . /etc/sysconfig/supervdsmd
 . /etc/init.d/functions
 
 log_failure_msg() { echo -n "$@"; failure "$@"; echo; }
@@ -36,8 +37,7 @@
 
         "@VDSMDIR@/daemonAdapter" -c /dev/null "@VDSMDIR@/respawn" \
             --minlifetime 10 --daemon --masterpid "${RESPAWNPIDFILE}" \
-            "@PYTHON@" "${SUPERVDSM_BIN}" --sockfile "${SOCKFILE}" \
-            --pidfile "${PIDFILE}"
+            "${SUPERVDSM_BIN}" --sockfile "${SOCKFILE}" --pidfile "${PIDFILE}"
         RETVAL=$?
         [ "$RETVAL" -eq 0 ] && log_success_msg "$prog start" || log_failure_msg "$prog start"
 }
diff --git a/vdsm/supervdsmd.service.in b/vdsm/supervdsmd.service.in
index 32a7a2b..33e960b 100644
--- a/vdsm/supervdsmd.service.in
+++ b/vdsm/supervdsmd.service.in
@@ -3,5 +3,6 @@
 
 [Service]
 Type=simple
-ExecStart=@PYTHON@ "@VDSMDIR@/daemonAdapter" "@PYTHON@" "@VDSMDIR@/supervdsmServer.pyc" --sockfile "@VDSMRUNDIR@/svdsm.sock"
+EnvironmentFile=-/etc/sysconfig/supervdsmd
+ExecStart=@PYTHON@ "@VDSMDIR@/daemonAdapter" "@VDSMDIR@/supervdsmServer" --sockfile "@VDSMRUNDIR@/svdsm.sock"
 Restart=on-abort


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifbcfcfb6f22040d038541c79ac4d0e66ac106504
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>


More information about the vdsm-patches mailing list