OpenRC/Prefix

This work is a reponse to.

The following guideline applies to a Gentoo Prefix on RHEL-5.6 amd64, for other setups it should be similar. Feel free to documents corner cases here.

Using heroxbd's openrc-prefix overlay
This is a temporary overlay only for OpenRC/Prefix testing. The changes will be reviewed and included in the official tree gradually. As of May 12, 2012, the overlay includes portage (for keeping /etc/{init,conf}.d dirs), openrc (for adding back Prefix support) and baselayout-prefix (to avoid file collision).

Get to a dir where you intend to put the overlay, say, ${HOME}/openrc.

Populate this directory to portage,

Replace the directory to yours. Details for playing with overlay can be found at Overlay.

install baselayout-prefix and portage from the overlay

 * Default portage in prefix removes /etc/{init,conf}.d directories with prompts like

emerge portage from heroxbd's overlay to disable this behavior.


 * baselayout-prefix comes from baselayout-1, which has file-collision with openrc. emerge baselayout-prefix from the overlay to remove the offending files.

Getting openrc-9999 emerged on prefix
openrc is not out of box now, first attempt gives

Let's eliminate the blocks.

glibc and sysvinit
In Gentoo Prefix, glibc and sysvinit are supposed to be provided outside Prefix by host OS. Let's tell portage that we have any version of glibc and sysvinit she wants:

now it becomes,

Finally emerge openrc-9999,

Unmask openrc-9999 as guided. (This is just a temperary solution, will be integraded into openrc soon.)

OpenRC config
Use the prefix feature set in openrc,

remove dmesg from sysinit, because we don't manange dmesg from Preifx

Example: tinc
tinc is a decentralized VPN. A tinc started from Gentoo Prefix can serve as a relay node in the VPN, if tun/tap is not available for normal user.

emerge tinc, or re-emerge to get its initd and confd files back with our new portage

prefixify init script
fix shebang in the init script,

fire up tincd from OpenRC
Make necessary changes in ${EPREFIX}/etc/conf.d/tinc.networks and ${EPREFIX}/etc/tinc according to your specific setup.

Add tincd into default runlevel

Finally we are done with

Example: nginx
nginx is a efficient lightweight http server.

emerge nginx, or re-emerge to get its initd and confd files back with our new portage

prefixify init script
fix shebang in the init script,

normal privilege

 * remove "user nginx nginx;" from the first line of ${EPREFIX}/etc/nginx/nginx.conf
 * You cannot listen on port 80 without root privilege. Change it to 8008,

External resources
Benda's OpenRC page