Skip to content

Commit

Permalink
CP-15135: Converted updatempppathd init script to systemd unit file
Browse files Browse the repository at this point in the history
Signed-off-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
Reviewed-by: Germano Percossi <germano.percossi@citrix.com>

GitHub: closes #301
  • Loading branch information
chandrikas committed Apr 25, 2016
1 parent 0a6b27c commit 9e98b3a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 111 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ install: precheck
$(SM_STAGING)/$(MODPROBE_DIR)
install -m 644 etc/logrotate.d/$(SMLOG_CONF) \
$(SM_STAGING)/$(LOGROTATE_DIR)
install -m 755 drivers/updatempppathd.init \
$(SM_STAGING)/$(INIT_DIR)/updatempppathd
install -m 644 drivers/updatempppathd.service \
$(SM_STAGING)/$(SYSTEMD_SERVICE_DIR)
install -m 644 etc/make-dummy-sr.service \
$(SM_STAGING)/$(SYSTEMD_SERVICE_DIR)
install -m 644 snapwatchd/snapwatchd.service \
Expand Down
108 changes: 0 additions & 108 deletions drivers/updatempppathd.init

This file was deleted.

10 changes: 10 additions & 0 deletions drivers/updatempppathd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Daemon to update all MPP LUN paths
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/opt/xensource/sm/updatempppathd.py -f

[Install]
WantedBy=multi-user.target
5 changes: 4 additions & 1 deletion mk/sm.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ rm -rf $RPM_BUILD_ROOT
service sm-multipath start
%systemd_post make-dummy-sr.service
%systemd_post snapwatchd.service
%systemd_post updatempppathd.service

[ -f /etc/lvm/lvm.conf.orig ] || cp /etc/lvm/lvm.conf /etc/lvm/lvm.conf.orig || exit $?
[ -d /etc/lvm/master ] || mkdir /etc/lvm/master || exit $?
Expand All @@ -57,6 +58,7 @@ update-alternatives --install /etc/multipath.conf multipath.conf /etc/multipath.
[ ! -x /sbin/chkconfig ] || chkconfig --del sm-multipath
%systemd_preun make-dummy-sr.service
%systemd_preun snapwatchd.service
%systemd_preun updatempppathd.service
#only remove in case of erase (but not at upgrade)
if [ $1 -eq 0 ] ; then
update-alternatives --remove multipath.conf /etc/multipath.xenserver/multipath.conf
Expand All @@ -66,6 +68,7 @@ exit 0
%postun
%systemd_postun make-dummy-sr.service
%systemd_postun_with_restart snapwatchd.service
%systemd_postun updatempppathd.service
if [ $1 -eq 0 ]; then
[ ! -d /etc/lvm/master ] || rm -Rf /etc/lvm/master || exit $?
cp -f /etc/lvm/lvm.conf.orig /etc/lvm/lvm.conf || exit $?
Expand All @@ -76,7 +79,6 @@ fi
%files
%defattr(-,root,root,-)
/etc/rc.d/init.d/mpathroot
/etc/rc.d/init.d/updatempppathd
/etc/udev/scripts/xs-mpath-scsidev.sh
/etc/xapi.d/plugins/coalesce-leaf
/etc/xapi.d/plugins/lvhd-thin
Expand Down Expand Up @@ -296,6 +298,7 @@ fi
/etc/rc.d/init.d/sm-multipath
%{_unitdir}/make-dummy-sr.service
%{_unitdir}/snapwatchd.service
%{_unitdir}/updatempppathd.service
%config /etc/udev/rules.d/40-multipath.rules
%config /etc/udev/rules.d/55-xs-mpath-scsidev.rules
%config /etc/udev/rules.d/58-xapi.rules
Expand Down

0 comments on commit 9e98b3a

Please sign in to comment.