Gentoo Archives: gentoo-soc

From: heroxbd@×××××.com
To: gentoo-soc@l.g.o
Subject: [gentoo-soc] [soc proposal] Daemons in Gentoo Prefix with OpenRC
Date: Wed, 04 Apr 2012 12:09:30
Dear all, 

I have composed and submitted a proposal as included inline
below. Online version is at

I am looking forward to have your comments to the proposal.


                 Daemons in Gentoo Prefix with OpenRC

Author: Benda Xu
Date: 2012-04-04 18:32:28 JST

Table of Contents
1 Abstract
2 Objective
3 Big Picture
4 Motive
5 Deliverables
    5.1 before mid-term
        5.1.1 Timeline (dates as deadlines) to achieve that
    5.2 final
        5.2.1 Timeline (dates as deadlines) to achieve that
6 Biography
    6.1 experiences
    6.2 toys at hand
    6.3 activities involved in Gentoo

1 Abstract 
  I am going to take the development of prefix support in OpenRC,
  deploy OpenRC to work with baselayout in Prefix, and extend Prefix
  with the long-waited feature[1] of services daemons.

2 Objective 
  Port OpenRC to Gentoo Prefix to organize daemons.

3 Big Picture 
  Gentoo Prefix is a Gentoo portage managed system installed in a
  prefix directory. The main purpose is to leverage the Gentoo Linux
  Portage tree to other Linux distributions, BSD variants, Solaris,
  hpux, aix and even WINNT.

  Gentoo Prefix is usually used by a normal user on the system,
  providing a systematic way to install new package into a shared
  computing environment without superuser privilege.
  After several years of development since 2006, Gentoo Prefix has
  grown mature, especially on most tested platforms like x86-linux,
  amd64-linux, x86-macosx, to name a few.

  At present, developers are actively porting changes in Gentoo Prefix
  back into the main Gentoo Portage tree (in Gentoo community called
  gentoo-x86), thanks to the introduction of new portage API,
  aka. "EAPI", 3 and 4[2].

4 Motive 
  Gentoo Prefix (hereafter Prefix) is a productive _foreground_
  environment. Daemons in Prefix can be run manually to be detached
  from foreground. This practice is not scalable, and soon becomes

  There was effort to address this issue since 2007 to have services
  in Prefix, documented in the (in)famous bug #196294[1]. The
  scheme works for linux Prefix, but non portable to other host OS
  like Solaris.

  At the same time, Gentoo/*BSD grows and calls for a portable init
  system that can be used across Linux and BSD kernel/userland. In
  2010, OpenRC project answered the call to design a platform-agnostic
  init system[3]. Now it matures and serves as default in Gentoo.

  Early effort of OpenRC includes a goal of supporting Prefix. But due
  to lack of man power and the habit of using Prefix only foreground,
  the Prefix plan was dropped in OpenRC git tree[4].

  At the same time, Prefix tree becomes an overlay on gentoo-x86,
  bringing Prefix closer (if not indistinguishable) to standard
  Gentoo[5]. It's time to reconsider background support in Prefix
  with in the light of OpenRC.

5 Deliverables 

5.1 before mid-term 
  1. functioning OpenRC tarball and ebuild on Prefix with superuser
     privilege (hereafter superuser Prefix)
  2. improved baselayout ebuild using OpenRC on superuser Prefix

5.1.1 Timeline (dates as deadlines) to achieve that 
    - <2012-04-10 Tue> Join Gentoo OpenRC herd and get familiar with the source tree.
    - <2012-04-11 Wed> Make a git branch out of OpenRC main and develop with it
    - <2012-04-30 Mon> Make it run with a directory prefix.
    - <2012-06-01 Fri> Make necessary changes to test cases where OpenRC is invoked by
      host rc system, manual invoking, or cron.
    - <2012-06-15 Fri> Introduce a mechanism to separate host rc only tasks from
      Prefix OpenRC, e.g. kernel module.
    - <2012-07-01 Sun> Patch baselayout-prefix to integrate OpenRC prefix branch.

5.2 final 
  1. functioning OpenRC tarball and ebuild on normal user Prefix,
     which is configurable to be used in superuser Prefix
  2. baselayout changes reviewed by Gentoo Base Project and merged
     back into gentoo-x86
  3. a reference arm-linux Prefix system running mldonkey[6],
     proftpd[7], tinc[8], nginx[9] from OpenRC for
     demonstration and community use.
  4. Gentoo documentation or function inside ebuild to guide end user
     to deploy OpenRC.

5.2.1 Timeline (dates as deadlines) to achieve that 
    - <2012-07-15 Sun> Reuse the mechanism to separate (or modify)
      super user only tasks from Prefix OpenRC, e.g. tuning kernel
      runtime parameters, binding TCP port less than 1024.
    - <2012-08-01 Wed> merge baselayout-prefix with baselayout-2. This
      is a by-product, in fact including OpenRC into Prefix requires
      modification of baselayout-prefix.
      If the porting OpenRC is done in a direction of making
      baselayout-prefix with baselayout-2 more similar, they can be
      merge into a Prefix-aware baselayout-2.
    - <2012-08-20 Mon> Use new baselayout and openrc ebuilds to build
      the demo system, provide access accounts for those who are
      interested. Document the build procedure as tutorial. If the
      deploying process needs manual tuning, compose Gentoo
      documentation to explain the details.

6 Biography 
  I am born in China and now studying in particle physics in Japan as
  a graduate student. I like tweaking electronic devices and computer
  programs. Right now I am really fond of travelling around the world
  and learning different languages.
  As a GNU/Linux user for 8 years since 2003, I use Debian for desktop
  and Gentoo Prefix for servers. I live in Emacs and stumpwm. I
  started to love Gentoo Prefix in 2010 and joined gentoo four months
  ago [10].

6.1 experiences 
           2005   translated Debian Sarge Release Note into Simplified Chinese[11]                           
     2007--2009   system administrator for student associations and dormitory in Tsinghua University, China  
           2009   intern in Lava Inc at Beijing, video streaming                                             
           2011   short intern at Intel China                                                                
      2011--now   Consultant for Tsinghua University student group of campus network administrators          

6.2 toys at hand 
   1. mips architecture
      - Planex MZK-W04NU running OpenWrt[12]
      - TP-Link WR1043ND running OpenWrt[12]
   2. arm architecture
      - Buffalo LS-VL running stock system with Gentoo Prefix
   3. powerpc architecture
      - Xilinx Virtex II PRO evaluation board, minimal Debian[13]
      - SONY PlayStation 3, jailbroken, planning to deploy Gentoo
   4. microblaze architecture
      - Xilinx Spartan 3 Starter Kit, minimal busybox

6.3 activities involved in Gentoo 
   I will just give a few links to my activities

   - my reported bugs: []
   - posts on gentoo-alt: []

[1] []

[2] []

[3] []

[4] [;a=commit;h=3247184d]

[5] []

[6] []

[7] []

[8] []

[9] []

[10] []

[11] []

[12] []

[13] []
XU Benda
Research Center for Neutrino Science
Tohoku University