diff mbox

[ovs-dev,2/2] openvswitch-switch.postinst: Remove upstart files.

Message ID 1498475114-6127-2-git-send-email-guru@ovn.org
State Accepted
Headers show

Commit Message

Gurucharan Shetty June 26, 2017, 11:05 a.m. UTC
For a while, ubuntu used upstart scripts as an alternative
for sysv scripts. For e.g popular releases like ubuntu12.04
and ubuntu14.04 have upstart infrastructure. From Ubuntu16.04,
they have moved to systemd.

Ubuntu maintainers have a fork of openvswitch packages with
upstart scripts. When a user installs openvswitch-switch
package on a ubuntu 14.04 with 'apt-get install openvswitch-switch',
two upstart files are added to /etc/init directory.

Now, when the same user builds debian packages from this repo
and then installs them, the older upstart files don't get
deleted. What this means is that a command like
'invoke-rc.d openvswitch-switch restart' calls initctl scripts
instead of sysv script that this repo provides. In our sysv
scripts we have logic to carefully upgrade kernel module and
save openflow flows. This breaks the intent of the package from
this repo.

This commit deletes any stale upstart files that have remained
in the system.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
---
 debian/openvswitch-switch.postinst | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Ben Pfaff July 12, 2017, 4:34 p.m. UTC | #1
On Mon, Jun 26, 2017 at 04:05:14AM -0700, Gurucharan Shetty wrote:
> For a while, ubuntu used upstart scripts as an alternative
> for sysv scripts. For e.g popular releases like ubuntu12.04
> and ubuntu14.04 have upstart infrastructure. From Ubuntu16.04,
> they have moved to systemd.
> 
> Ubuntu maintainers have a fork of openvswitch packages with
> upstart scripts. When a user installs openvswitch-switch
> package on a ubuntu 14.04 with 'apt-get install openvswitch-switch',
> two upstart files are added to /etc/init directory.
> 
> Now, when the same user builds debian packages from this repo
> and then installs them, the older upstart files don't get
> deleted. What this means is that a command like
> 'invoke-rc.d openvswitch-switch restart' calls initctl scripts
> instead of sysv script that this repo provides. In our sysv
> scripts we have logic to carefully upgrade kernel module and
> save openflow flows. This breaks the intent of the package from
> this repo.
> 
> This commit deletes any stale upstart files that have remained
> in the system.
> 
> Signed-off-by: Gurucharan Shetty <guru@ovn.org>

Thanks for finding and fixing the problem.  This sounds like it was
really mysterious.

Would you please add some appropriate comments to the script that
explains what's going on?

Acked-by: Ben Pfaff <blp@ovn.org>
diff mbox

Patch

diff --git a/debian/openvswitch-switch.postinst b/debian/openvswitch-switch.postinst
index 126e8fe..37e62b7 100755
--- a/debian/openvswitch-switch.postinst
+++ b/debian/openvswitch-switch.postinst
@@ -33,6 +33,12 @@  case "$1" in
                     fi
                 done
         fi
+        if [ -e "/etc/init/openvswitch-switch.conf" ]; then
+            rm /etc/init/openvswitch-switch.conf
+        fi
+        if [ -e "/etc/init/openvswitch-force-reload-kmod.conf" ]; then
+            rm /etc/init/openvswitch-force-reload-kmod.conf
+        fi
         ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)