Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Mike Kelly <pioto@...>
Subject: GLEP 27 - API Specs
Date: Sat, 29 Jul 2006 22:15:38 -0400
Hi,

Attached is a draft of my API spec for my GLEP 27 implementation
(user/group management for package managers). Any feedback would be
appreciated. The latest version of this document can also be found in
my subversion repository[1]. Thanks!

[1] http://soc.gentoo.org/viewcvs.py/*checkout*/glep0027/trunk/dynusers/API

-- 
Mike Kelly
"Happiness adds and multiplies as we divide it with others."
This is a sketch of the basic "API" for interfacing with the dynusers scripts.

There are several different tasks which these scripts must do:

  1. Maintain a database of users and groups that have been added by the
     scripts. These databases contain a newline separated list of package
     identifiers (name and version, usually), which mainly serves to tell the
     scripts when a user is no longer used by any package on the system.
     Database actions should all go through the db.sh script.

     This can be invoked in 2 different modes:

       db.sh add dbtype pkgname newname [root]

         Adds an entry to the database. dbtype is one of user or group, pkgname
         is a unique package identifier (category, name, and version), newname
	 is the name of the user or group to be added. The optional parameter,
	 root, defines the system root to install into. If not provided, it is
         assumed to be /.

       db.sh del pkgname [root]

         Removes all instances of pkgname from the database. This is what is
         run when a package is removed, or upgraded (the old version needs to
         be removed from the database). The optional parameter, root, is the
         same as above.

  2. Add any users or groups requested by a new package to the system. At the
     same time, the database should be updated. This action is performed by the
     add.sh script. It should be run once, before the package is unpacked,
     compiled, or installed. It is invoked as follows:

     add.sh "new users list" "new groups list" pkgname userspace [root]

       "new users list" - a single parameter, a space-separated list of new
       users to be added for this package.

       "new groups list" - same as above, only for groups.

       pkgname - a unique identifier for the package about to be installed
       (category, name, and version).

       userspace - a unique identifier of the userspace we are running in. This
       is something of the form USERLAND-ELIBC. For example, most GNU/Linux
       systems would specify GNU-glibc, while FreeBSD-based systems would use
       BSD-FreeBSD.

       root - an optional parameter, defines the system root to install into.
       If not provided, assumes /.

  3. Revert any changes made if an install fails. This is done by calling
     install_fail.sh with the same arguments as add.sh. It will know what needs
     to be done to clean up from itself (i.e. roll back the database, remove
     any unnecessary users or groups, etc).

  4. Display information about the managed users and groups, including which
     ones may be safely removed, and offer the operator a way to remove them
     elegantly (meaning cleaning up the database as well as removing them from
     the system). This is handled by the users.eselect script.
Attachment:
signature.asc (PGP signature)
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
webdav global use flag and default
Next by thread:
last ritest for dev-java/saxon-bin
Previous by date:
Re: Re: proxy-dev (an alternative to sunrise?)
Next by date:
Re: proxy-dev (an alternative to sunrise?)


Updated Jun 17, 2009

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.