Zhou Zheng Sheng has posted comments on this change.

Change subject: Add vdsm upstart jobs
......................................................................


Patch Set 2:

(2 comments)

Thanks Antoni and Alon. I'm working on a new patch to move systemd, sysvinit 
and upstart files to respective sub-directories, then I'll rebase the current 
patch on that one. I'll also update this patch when we agree on the dependency 
solution.

....................................................
File vdsm/vdsm-tmpfiles.upstart.in
Line 8: 
Line 9: task
Line 10: 
Line 11: script
Line 12: while read Type Path Mode User Group ; do
Done
Line 13:     if [ ! -e "$Path" ]; then
Line 14:         if [ "$Type" = "d" ]; then
Line 15:             @MKDIR_P@ "$Path"
Line 16:         else


....................................................
File vdsm/vdsmd.upstart.in
Line 10: nice -20
Line 11: respawn
Line 12: 
Line 13: pre-start script
Line 14:     "@LIBEXECDIR@/vdsmd_init_common.sh" --start-needed-srv "ntp 
open-iscsi multipath-tools wdmd sanlock portmap libvirt-bin supervdsmd"
1. Some of our dependencies are SysV services, but Upstart does not support 
depending on SysV services, so we need to start them if they are not up.

2. There is no SystemD-like dependency equivalent in Upstart job, because 
Upstart works in the reverse way to SystemD. If I use

  start on started libvirt-bin and started portmap ...

, vdsmd will be started after libvirt-bin and portmap is started, but when 
libvirt-bin is stopped and I use initctl start vdsmd, Upstart does not 
automatically start libvirt-bin for me. To have Upstart automatically start 
dependencies as SystemD, I have to add another Upstart jobs as follow.

vdsmd-dependency.upstart.in
  start on starting vdsmd
  stop on stopped vdsmd
  task
  script
      "@LIBEXECDIR@/vdsmd_init_common.sh" --start-needed-srv "ntp open-iscsi 
multipath-tools wdmd sanlock portmap libvirt-bin supervdsmd"
  end script

and in vdsmd.upstart.in

  start on started libvirt-bin and started portmap ...
  stop on stopped vdsmd-dependency RESULT=failed or stopping libvirt-bin or 
stopping portmap ...

I think this translation is complicated, so I decide to call 
vdsmd_init_common.sh directly in pre-start script, simpler.

3. In fact there is a further problem.

I found a problem in Upstart, it does not fully restart libvirt-bin and re-read 
environment file.  So when I was implementing vdsm-tool service managment, I 
let service-restart firstly stop libvirt-bin, then start libvirt-bin again, to 
make it re-read the environment file.

When vdsmd starts and re-configures libvirt, the libvirt-bin service will be 
fully restarted (stop -> start) by vdsm-tool. If we have a dependency to 
libvirt-bin, then vdsmd will be stopped. This creates a circular wait 
situation. vdsmd is waiting for libvirt-bin to stop so as to start it again, 
but Upstart is waiting for vdsmd to stop before stopping libvirt-bin, at last 
Upstart itself is locked. So in the next patch I want to remove "stop on 
stopped libvirt-bin".

So the final solution looks like following.

  start on runlevel [2345] and started networking and started supervdsmd and 
started libvirt-bin and started portmap
  stop on runlevel [!2345] or stopping supervdsmd
  
  pre-start script
      "@LIBEXECDIR@/vdsmd_init_common.sh" --start-needed-srv "networking ntp 
open-iscsi multipath-tools wdmd sanlock portmap libvirt-bin supervdsmd"
  end script
Line 15:     "@LIBEXECDIR@/vdsmd_init_common.sh" --pre-start
Line 16: end script
Line 17: 
Line 18: # All commands called inside this script section except the daemon 
itself


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id68ec0197bd1e09100f5da96ac4db24f2b90753a
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to