switch swift to use systemd init

Bug #1827340 reported by Tytus Kurek
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
swift (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

It looks like the most recent version of the swift-container package is missing Upstart and System V files for the container-sharder service:

root@swift:~# apt-cache policy swift-container
swift-container:
  Installed: 2.21.0-0ubuntu1~cloud0
  Candidate: 2.21.0-0ubuntu1~cloud0
  Version table:
 *** 2.21.0-0ubuntu1~cloud0 500
        500 http://ubuntu-cloud.archive.canonical.com/ubuntu bionic-updates/stein/main amd64 Packages
        100 /var/lib/dpkg/status
     2.17.1-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
     2.17.0-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
root@swift:~#
root@swift:~#
root@swift:~#
root@swift:~# dpkg -L swift-container
/.
/etc
/etc/init
/etc/init/swift-container-auditor.conf
/etc/init/swift-container-replicator.conf
/etc/init/swift-container-sync.conf
/etc/init/swift-container-updater.conf
/etc/init/swift-container.conf
/etc/init.d
/etc/init.d/swift-container
/etc/init.d/swift-container-auditor
/etc/init.d/swift-container-replicator
/etc/init.d/swift-container-sync
/etc/init.d/swift-container-updater
/etc/swift
/etc/swift/container-server.conf
/usr
/usr/bin
/usr/bin/swift-container-auditor
/usr/bin/swift-container-info
/usr/bin/swift-container-reconciler
/usr/bin/swift-container-replicator
/usr/bin/swift-container-server
/usr/bin/swift-container-sharder
/usr/bin/swift-container-sync
/usr/bin/swift-container-updater
/usr/bin/swift-manage-shard-ranges
/usr/bin/swift-reconciler-enqueue
/usr/share
/usr/share/doc
/usr/share/doc/swift-container
/usr/share/doc/swift-container/changelog.Debian.gz
/usr/share/doc/swift-container/container-server.conf-sample
/usr/share/doc/swift-container/container-sync-realms.conf-sample
/usr/share/doc/swift-container/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/swift-container-auditor.1.gz
/usr/share/man/man1/swift-container-info.1.gz
/usr/share/man/man1/swift-container-reconciler.1.gz
/usr/share/man/man1/swift-container-replicator.1.gz
/usr/share/man/man1/swift-container-server.1.gz
/usr/share/man/man1/swift-container-sync.1.gz
/usr/share/man/man1/swift-container-updater.1.gz
/usr/share/man/man5
/usr/share/man/man5/container-reconciler.conf.5.gz
/usr/share/man/man5/container-server.conf.5.gz
/usr/share/man/man5/container-sync-realms.conf.5.gz

This disallows managing the service through the 'service' or 'systemctl' commands which is required for the following bug:

https://bugs.launchpad.net/charm-swift-storage/+bug/1826859

Tytus Kurek (tkurek)
tags: removed: field-medium
Tytus Kurek (tkurek)
Changed in swift (Ubuntu):
assignee: nobody → Tytus Kurek (tkurek)
Revision history for this message
Tytus Kurek (tkurek) wrote :

Patch attached

Changed in swift (Ubuntu):
status: New → In Progress
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "lp1827340.patch" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Bryan Quigley (bryanquigley) wrote :

I don't see the point in enabling Upstart (or sysv init.d jobs) at this point - unless I really don't understand how this will be used Upstart jobs won't do anything on modern releases of Ubuntu.

Instead perhaps using similar systemd jobs that Debian has -https://packages.debian.org/sid/all/swift-container/filelist

Revision history for this message
Tytus Kurek (tkurek) wrote :

I agree that it reveals a deeper issue. Would you suggest to remove all old Upstart / System V files (for all Swift services) and replace them with Systemd files?

Revision history for this message
Bryan Quigley (bryanquigley) wrote :

Yea, I'd be for going systemd unit files only. They will always take precedence on 18.04+, so might as well only provide them.

Tytus Kurek (tkurek)
Changed in swift (Ubuntu):
status: In Progress → New
assignee: Tytus Kurek (tkurek) → nobody
Tytus Kurek (tkurek)
Changed in swift (Ubuntu):
status: New → In Progress
assignee: nobody → Tytus Kurek (tkurek)
Revision history for this message
Tytus Kurek (tkurek) wrote :

Hi Bryan,

I'm attaching an updated patch, however, as this is the first time I'm creating a patch for ubuntu package, I am not sure whether everything is correct. Please have a look and let me know if anything has to be changed.

Regards

Tytus

Revision history for this message
Bryan Quigley (bryanquigley) wrote :

Hi Tytus,

I did a once over and it looks good to me. I'm far from an expert though. I think they use git-ubuntu for this, but I'd check with one of the maintainers.

Thanks,
Bryan

Mathew Hodson (mhodson)
Changed in swift (Ubuntu):
importance: Undecided → Low
Revision history for this message
Tytus Kurek (tkurek) wrote :

Hi Mathew,

Is there any chance to move this forward?

Thanks

Revision history for this message
Dan Streetman (ddstreet) wrote :

Hello,

generally, changes like this should be done in Debian first, however the 'cloud' packages can sometimes be special.

@corey.bryant, do you have an opinion on changing the swift sysv init scripts over to normal systemd services (meaning, @tkurek doing the work with me assisting him)? If you're ok with that, would you prefer it go into Debian first, or just carry it in Ubuntu (I assume Debian first, but just checking).

@tkurek, assuming Corey doesn't object to the systemd service change in general, and prefers it in Debian, there are generally two ways to get changes into Debian, either open a bug with the debdiff attached, or open a Debian Salsa merge request.

The Debian swift bug trackers shows no bugs currently:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=swift
but you could open one with the debdiff fairly easily, by using the 'submittodebian' script from the ubuntu-dev-tools package. Its manpage is not super descriptive, but essentially you just need to run the script from the package source you want to patch. If you have questions about its usage let me know.

Alternately (or additionaly) you can try opening a salsa merge request:
https://salsa.debian.org/openstack-team/services/swift
you will need to create a 'guest' salsa account, and after that it's basically the same process as github/gitlab.

I've subscribed to this bug so let me know if I can help with any further steps in the process.

tags: added: ubuntu-sponsor-ddstreet
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Hi Tytus and Dan,

Thanks for the patches Tytus. Always appreciate contributions!

Generally for the core openstack packages they don't follow the normal sync from debian flow for a number of reasons and the packages tend to differ quite a bit.

The swift package in Debian has already moved to systemd though, and they went with a generated approach. To see what they did, pull-debian-source swift and take a look at the debian/*init.in files and debian/rules override_dh_installinit, override_dh_installsystemd.

I'll need to dig in deeper to understand if one approach is any better than the other.

I'd like to make the switch one way or the other, but I'm not sure that I want to do it at this point in the Focal cycle. I would prefer early G cycle.

Thanks,
Corey

Revision history for this message
Tytus Kurek (tkurek) wrote :

Dan / Corey,

Thank you very much for looking into it. I don't think it's a priority any more, but still worth finalising and merging. Unfortunately, I have no more time to drive it, so I will have to leave it in your hands.

Thank you

Tytus

Revision history for this message
Dan Streetman (ddstreet) wrote :

> The swift package in Debian has already moved to systemd though, and they
> went with a generated approach. To see what they did, pull-debian-source
> swift and take a look at the debian/*init.in files and debian/rules
> override_dh_installinit, override_dh_installsystemd.

oh wow, it looks like Debian has included a script to generate systemd service files since 2016:

https://salsa.debian.org/openstack-team/services/swift/-/commits/debian/ussuri/debian/gen-init

that generator approach isn't one I have seen before.

In any case, thanks for looking at this in the G cycle Corey!

Mathew Hodson (mhodson)
summary: - swift-container package is missing Upstart and System V files for the
- container-sharder service
+ init not configured for the container-sharder service
Revision history for this message
Corey Bryant (corey.bryant) wrote : Re: init not configured for the container-sharder service

By the way, just in the mean time there is an init script for swift-container-sharder in Ussuri.

Revision history for this message
Corey Bryant (corey.bryant) wrote :

I'm going to change the topic of this bug to focus on switch to systemd init.

summary: - init not configured for the container-sharder service
+ switch swift to use systemd init
Ryan Beisner (1chb1n)
Changed in swift (Ubuntu):
assignee: Tytus Kurek (tkurek) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package swift - 2.25.0-0ubuntu3

---------------
swift (2.25.0-0ubuntu3) groovy; urgency=medium

  * d/t/swift-daemons: Update to give systemd units time to restart.

 -- Chris MacNaughton <email address hidden> Thu, 25 Jun 2020 11:30:03 +0000

Changed in swift (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.