Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Debian packages and "upgrade" support

Posted on 2011-09-02
4
Medium Priority
?
430 Views
Last Modified: 2012-05-12
Hi guys,

I'm designing a product, written in C and runs on a standard installation of Debian Lenny.

We install it to our own dedicated hardware (basically an Intel Xeon server) via a locally managed debian repository. We use Debian's normal package management system to deploy and upgrade the product.

It is installed on our own hardware so we have rigid control over exactly what is on every machine.

Currently our package installation scripts - postinst, preinst, postrm, prerm, etc. have support for installing, removing, and purging the package that contains our software.

I have been tasked with implementing "upgrade" support. Currently the only functionality we have to upgrade the software is to remove the existing package, and reinstall the new one - it is destructive to our configuration, database, etc. which is obviously not ideal.

I don't really know how Debian's package manager handles "upgrades".

I know there are places where you can hook in to the upgrade process, e.g. preinst and postinst are called with  "upgrade" arguments. I am currently studying this document:

http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html

But I was hoping I could get your expert opinions on how Debian package upgrade works from a package-developer's point of view and generate some high-level discussion on what I should be doing and looking for as far s implementing upgrade functionality in our package system goes.

Thanks!
0
Comment
Question by:Frosty555
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 38

Expert Comment

by:wesly_chen
ID: 36474524
This is just a thought, not actually Debian upgrade doing.

For update/upgrade package, in deb package file, it contains the file list as meta data.
So, group those files into binary, document (man page) and configuration files.
When update, compare the file list,
1. overwrite the exist ones (files) except for the configuration files. New configuration files install as <filename>_debnew

2. delete those files in previous version only (Need to have file list comparison result).

3. Update the deb meta database for new version installation (with new files installed list).

So you don't need to uninstall the previous version.
So of packages like server/daemon need to in preinst to check the daemon running status and shut it down
before file overwriting.
0
 
LVL 31

Accepted Solution

by:
Frosty555 earned 0 total points
ID: 36543429
Hi Wesly,

While I appreciate your suggestions, we're reinventing the wheel which is exactly what I was trying to avoid by using debian's existing (and already very mature) package upgrade system.

I found this document:

http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html

Which precisely describes what I was looking for - a good description of the Debian package scripts, and a precise specification for exactly how an upgrade happens from a developer's point of view.
0
 
LVL 31

Author Closing Comment

by:Frosty555
ID: 36565440
found whitepaper on the subject
0
 
LVL 31

Author Comment

by:Frosty555
ID: 36543449
I realize looking at my comments now that the document I just posted is actually exactly the document I was talking about in my original question.... how about that!

I think what has happened here is that now I've spent some time diving into debian packages and understanding how they work, I finally UNDERSTAND that document. I didn't really know what it was talking about before, but now that I have done more research I have a better context and high level understanding of Debian packages from a developer's point of view, I understand the document and it is exactly the information I needed.

That high level overview of Debian package maintainer scripts from a developer's perspective was what I was trying to discuss in this question - I was hoping for a little more response. Oh well.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question