OUT OF DATE, PLEASE READ POST # 6 BELOW

READY FOR USER :)

note : i have switched my personnal system under it :) for a little time now and i use it in production.

http://skarnet.org/software/
https://github.com/Obarun/obarun-pkgbuild-testing/tree/master/s6
http://obarun.org/forum/viewtopic.php?id=139
-------------------------------------------------------
About ISO :

md5sums :
a604fdb4169cdc9127ba56e522b33df5
http://obarun.org/obarun-iso/s6-v0.0.3/obarunS6_x86_64-v0.0.3.iso

THIS ISO CAN BE USED ON PRODUCTION :)

Use the same login/password as Obarun iso, see download page.
------------------------------------------------------

TODO : last edit 2016/06/06
- Implement lvm2
- Implement cryptab

need tester here to make lvm2 available correctly
-------------------------------------------------------

***************************************************** Why another supervisor *****************************************************

The goal of this projects is clear : replacing runit by S6. Why ? Well, for a huge of reason but principaly :

- Make a PID 1 as small as possible
- Having a log as early as possible
- Having a log for all services needed to boot the machine
- Possibility to make a dependencies tree for service
- Parallezisation for all the booting proccess.
...
All this features is available with S6 and much more.
I test and build this projects on REAL hardware, no virtualization here :).

This tread is dedicate to this projects.So, don't hesitate to give a feedback here.
Assumptions : you use the original initramfs coming from Arch, this assumption will be change in the future

***************************************************** How to test it *****************************************************

EDIT=2016/06/06. The official release and stable will coming soon. When it's ready, the possibility to install s6 with runit on the same system will be not permit with pacman! So enjoy before the change :)
So, following these lines, you can boot obarun on S6. DO NOT USE FOR PRODUCTION, is not ready.

install the necessary package :
$ sudo pacman -S execline skalibs s6 s6-rc s6-linux-utils s6-portable-linux s6-boot s6opts
WARNING : the package s6-boot provide the necessary to boot the machine correctly and 3 tty, but do not provide any user service for a classic utilisation. I mean, you don't have service like dhcpcd, dbus, alsa... . You must install what you needs.
Some service can be found here (the list will grow with the time) : https://github.com/Obarun/obarun-s6serv and obviously, the compiled package on obarun repository.

now you need to edit on syslinux.cfg/grub the line append with
 APPEND blablabla init=/etc/s6/init
Futhermore, An important change is made with S6. For the moment obarun boot with rw options on boot for the / filesystem. The boot sequence under S6 make a change about it.
The append line in /etc/syslinux/syslinux.cfg need to contains the ro mount options. The boot sequence doesn't need a rw options for a majority of it.
The bundle (see below) boot-rofs is made before mounting the / filesystem with rw options. The bundle boot-rwfs mount the / with ro options.

That's it, you are ready to boot on S6 :)

Useful command :
- reboot :
$ /etc/s6/reboot
- poweroff :
$ /etc/s6/poweroff
note : to avoids conflicts with runit, those files are on /etc/s6. This behaviour will be change in the future.

***************************************************** How it works *****************************************************

Stage 1

Runit start file /etc/runit/1 ( PID 1 ) first. This file contents a series of command to boot the machine in sequential mode (no parallelization here).
S6 start the file /etc/s6/init. This file content a serie of command to start earlier as possible a supervision of service directory. This is completely different. So in fact all that we can find on PID 1 under Runit is found on stage 2 under S6. We take a look on the end of init file :
redirfd -wnb 1 /run/s6-run/service/s6-svscan-log/fifo # ######## [i]with this command, all the message on stdin is redirected on a fifo file. so now we have a trace of what happens.[/i]

# Now we are good for pid2, start it
background { # ######## [i]background means that the scripts do not wait the end of the block before continuing to read/execute the rest[/i]
  s6-setsid --
  redirfd -w 1 /run/s6-run/service/s6-svscan-log/fifo # ############## [i]all message from stdin is redirected on fifo file[/i]
  fdmove -c 2 1 # ##### [i]all the stderr message are redirected to stdin , so in fact fifo file[/i]
 /etc/s6/stage2 # ######### [i]now the stage 2 is started but, it's started on a background here, parallelization begin :)[/i]
}

unexport !
fdmove -c 2 1
s6-svscan -st0 /run/s6-run/service # ###### [i]now service containing in /run/s6-run/service is started, WATHEVER HAPPENS on stage 2[/i]
As you can see init is very small : better for debugging, better for stability, better for rapidity and we have an earlier log. But, we don't have a fully operational system before starting the /run/s6-run/service directory service. This is important to keep in mind this behaviour.
We find in /etc/s6/svc-serv/ service started by stage 1. In our case, the necessary to provide log and 3 tty for debugging purpose. if something wrong happens on stage 2, we can access on the machine :), very useful. But we can define e.g. a service for earlier internet connection.
So this directory should not contain a service e.g. for udev because the system is not ready yet.

Stage 2

Runit start the necessary service for the system (udev,dbus,internet connection....). But this service is started when we have a fully operational system, and runit doing this on parallelization mode.
S6 start service to provide a fully operational system AND other service needed to use the system. We take a look on /etc/s6/stage2 :
if -nt {
	if { s6-echo -- "***************************************************************************" }
	if { s6-echo -- "**                        Start Stage 2                                  **" }
	if { s6-echo -- "***************************************************************************" }
	# start service
	if { s6-rc-init -c /etc/s6/compiled/current /run/s6-run/service } # #### [i]choose which directory s6-rc use for service and where to put it[/i]
	if { s6-rc -u change All } # ###### [i]tell to s6-rc which services/bundles need to be started first[/i]
	if { s6-echo -- "***************************************************************************" }
	if { s6-echo -- "**                        Stage 2 completed                              **" }
	s6-echo -- "***************************************************************************" 
}

redirfd -w 1 /dev/console
s6-echo "Something wrong on stage2, log to debug it"
As you can see, this file is very very small :). So now the things goes to complexity ( a little ).

S6-rc is used to manage a dependencies of service tree. It means, we need to do some things before other, e.g. verify if all the mountpoint exist before doing anything else.
All the service for doing this can be found in /etc/s6/rc-serv-boot. The work about service tree is made "offline", then s6-rc-compile is called to make a database of this work, then s6-svscan control this database. see here http://skarnet.org/software/s6-rc/overview.html.
So, on every directory under /etc/s6/rc-serv-boot content a serie of file to properly start a service.

We have "3 sort of service" :
longrun : classic service like udev
oneshot : service is started one time
bundle : a list of services

for the longrun we need to define those file :
type : type of the service, in this case longrun
run : like runit. So this file can be replaced by runit run file, if you want, or call an another file etc etc.
finish : like runit ( can be empty )
dependencies : this file contents the service that need to be launched before the service itself. This file can be exist or not depends of the purpose.
and another : please see here http://skarnet.org/software/s6-rc/s6-rc-compile.html

for the oneshot we need to define those file :
type : type of the service, in this case oneshot
up : what is made on start
down : what is made on stop ( can be empty )
dependencies : this file contents the service that need to be launched before the service itself
and another : .....

for the bundle we need to define those files :
type : type of the service, in this case bundle
contents : the list of the service which will started

The better is to take a look on rc-serv-boot directory :) for understanding the things

Well, on runit all the service in made on /etc/sv then symlinks are created to /var/service to enable the service. This is a little different on S6. Those directories /etc/s6/svc-serv, /etc/s6/compiled/some_database (compiled database of rc-serv-boot and /etc/s6-serv/enabled) are entirely copied as it on the directory /run/s6, then a symlinks is created at /etc/s6-run. So, in fact, the working directory is never modified on running time (better for security reason).

Some explanation about /etc/s6/rc-serv-boot directory :

This directory concerns the off works about service.

The first directory called is "All" by the command "s6-rc -u change All".
All :
This is a bundle named service.
The file "contents" is the list of the services started.
Those names may be : a another bundle e.g. all-Boot or service
Those names can be : a services or an another bundle.

To better clarity, a "code name" was created :
a name beginning by a majuscule signify that's a bundle e.g : "All"
a name beginning by the name of a bundle signify that's the service/bundle is declared onto the bundle name e.g. : all-Boot. all-Boot depends of bundle All.
a name beginning by the name of a bundle AND the name after the underscore begin by a majuscule, signify that's a another bundle e.g : all-Boot is a dependency of bundle All and it's a bundle itself.

With this principle, we can see quickly who depends of who e.g : rofs-console depends of the bundle boot-Rofs which depends of all-Boot bundle which depends of All bundles. With a little practice it can be easy :).
The bundle all-Boot concerns all the services/bundles needed to boot the system properly, DO NOT TOUCH THIS BUNDLE if you don't know what you are doing.
The bundle all-User concerns all the services/bundles needed by the user to run the system.

Normaly, you don't need to touch anything on this directory. Change some things on it can broke the boot procedure if you don't know what you do.

Some explanation about /etc/s6-serv/ directory :

We have at /etc/s6-serv two folder : available and enabled.
The folder available is used by pacman to install xxx-s6serv package. The s6-boot package install two folder onto it : all-User, boot-ready. NEVER ERASE/CHANGE those folders if you do not know what you do.
The folder enabled is used by an user to to create a database compilation source of services. This folder contains a list of sub-directory which contains symlinks pointing at /etc/s6-serv/available. By default, a sub-directory named default is created with s6-boot package.

So if you want to create quickly a service for e.g. openntpd :
create the directory /etc/s6-serv/available/user-openntpd. Under it create these files :
run : you can take the file run from runit :)
type : declare it as longrun
finish : you can take the file finish from runit
dependencies : declare on it the service boot-ready. This allow you to be sure that the system is fully operationnal.

To enable it on the live database, please see here http://obarun.org/forum/viewtopic.php?id=139
for managing service please see this for s6-rc : http://skarnet.org/software/s6-rc/s6-rc.html and this for s6-svscan http://skarnet.org/software/s6/s6-svscanctl.html

about s6.conf :

The file can be found in /etc/s6/s6.conf. So these is the file which must be modified if needed (e.g. keymap).
During boot time, s6.conf is parsed and written on multiple file (one by variable) at /run/s6-conf/.
When a service need to read a variable, it goes to /etc/s6/env/s6-conf which is a symlink pointing to /run/s6-conf.

For the moment, the file s6.conf is parsed on file init, not sure that's a good idea. If A crash occuring during the parsing, it block the boot init.
I haven't tested this but I would assume this:-
pid2-base pid2-build
Creates services?? If not than how would I go about duplicating run scripts from runit to s6? If yes than what specific services?
eric wrotehoping this is clear (not sure lol)
It was perfectly clear, thanks! :D Perhaps it was just me that hadn't put your previous posts into context as I see my error in that. Thus I have no further comments for the moment but I will refer back to this post when I test s6 (which is going to be a while :/)
12 days later
just pushed update on github, we have log now for udevd, udevadm, a complete syslog system and log for dbus, dhcpcd service. :).
Trouble exit already on udevd log, but the system boot perfectly, so the works continue :)
22 days later
Iptables,forcechck was added as option on /etc/s6.conf :
# Use Iptables [yes|no]
# The configuration file in /etc/iptables/iptables.rules MUST exist
IPTABLES=no

# Use Iptables6 [yes|no]
# The configuration file in /etc/iptables/ip6tables.rules MUST exist
IP6TABLES=no

# Force check disk/filesystem
FORCECHCK=no
IPTABLES is launched before network connection. Well better for security. You MUST HAVE a valid /etc/iptables/iptables.rules file for iptables and/or /etc/iptables/ip6tables.rules file for ip6tables. If the files is not valid the boot process come in trouble. This is an expected behaviour here, we enable a security. But we have a valid tty (thanks Laurent Bercot :) ) to debug it.

FORCECHCK simply force a check of the disk.

Note : the stage3 now clean the directory /tmp entirely at shutdown process
6 days later
LAST EDIT : 2016/06/16

version : 0.1.1. For the moment the package can be found on testing repo. I'm strongly recommend to test and use this vesion as earlier as possible. This version will become the official version on obarun repo.

This version is now in conflicts with runit

http://skarnet.org/software/
https://github.com/Obarun/obarun-pkgbuild-testing/tree/master/s6
http://obarun.org/forum/viewtopic.php?id=139
-------------------------------------------------------
About ISO :

http://obarun.org/obarun-iso/s6-v0.0.4/obarunS6_x86_64-v0.0.4.iso

Use the same login/password as Obarun iso, see download page.
------------------------------------------------------

TODO : last edit 2016/06/06
- Implement lvm2
- Implement cryptab

need tester here to make lvm2 available correctly
-------------------------------------------------------

***************************************************** How to test it *****************************************************

note: s6-boot s6opts become from testing repo until the date of 2016/06/23

install the necessary package :
$ sudo pacman -S execline skalibs s6 s6-rc s6-linux-utils s6-portable-linux s6-boot s6opts
WARNING : the package s6-boot provide the necessary to boot the machine correctly and 2 tty, but do not provide any user service for a classic utilisation. I mean, you don't have service like dhcpcd, dbus, alsa... . You must install what you needs.
Some service can be found here (the list will grow with the time) : https://github.com/Obarun/obarun-s6serv,https://github.com/Obarun/obarun-s6rcserv and obviously, the compiled package on obarun repository.

Futhermore, An important change is made with S6. For the moment obarun boot with rw options on boot for the / filesystem. The boot sequence under S6 make a change about it.
The append line in /etc/syslinux/syslinux.cfg need to contains the ro mount options. The boot sequence doesn't need a rw options for a majority of it.
The bundle (see below) boot-rofs is made before mounting the / filesystem with rw options. The bundle boot-rwfs mount the / with ro options.

That's it, you are ready to boot on S6 :)


***************************************************** How it works *****************************************************

please this careful, a number of directories was changed/added compared to the old version

Stage 1

Runit start file /etc/runit/1 ( PID 1 ) first. This file contents a series of command to boot the machine in sequential mode (no parallelization here).
S6 start the file /usr/bin/init. This file content a serie of command to start earlier as possible a supervision of service directory. This is completely different. So in fact all that we can find on PID 1 under Runit is found on stage 2 under S6. We take a look on the end of init file :
redirfd -wnb 1 /run/s6-run/service/s6-svscan-log/fifo # ######## [i]with this command, all the message on stdin is redirected on a fifo file. so now we have a trace of what happens.[/i]

# Now we are good for pid2, start it
background { # ######## [i]background means that the scripts do not wait the end of the block before continuing to read/execute the rest[/i]
  s6-setsid --
  redirfd -w 1 /run/boot/service/s6-svscan-log/fifo # ############## [i]all message from stdin is redirected on fifo file[/i]
  fdmove -c 2 1 # ##### [i]all the stderr message are redirected to stdin , so in fact fifo file[/i]
 /etc/s6/stage2 # ######### [i]now the stage 2 is started but, it's started on a background here, parallelization begin :)[/i]
}

unexport !
fdmove -c 2 1
s6-svscan -st0 /run/boot/service # ###### [i]now service containing in /run/boot/service is started, WATHEVER HAPPENS on stage 2[/i]
As you can see init is very small : better for debugging, better for stability, better for rapidity and we have an earlier log. But, we don't have a fully operational system before starting the /run/boot/service directory service. This is important to keep in mind this behaviour.
We find in /etc/s6/boot-serv/ service started by stage 1. In our case, the necessary to provide log and 2 tty for debugging purpose. if something wrong happens on stage 2, we can access on the machine :), very useful. But we can define e.g. a service for earlier internet connection.
So this directory should not contain a service e.g. for udev because the system is not ready yet.

Stage 2

Runit start the necessary service for the system (udev,dbus,internet connection....). But this service is started when we have a fully operational system, and runit doing this on parallelization mode.
S6 start service to provide a fully operational system AND other service needed to use the system. We take a look on /etc/s6/stage2 :
if -nt {
	if { s6-echo -- "***************************************************************************" }
	if { s6-echo -- "**                        Start Stage 2                                  **" }
	if { s6-echo -- "***************************************************************************" }
	# start service
	if { s6-rc-init -l /run/boot-rc -c /etc/s6/compiled/current /run/boot/service }
	if { s6-rc -l /run/boot-rc -u change All }
	if { s6-echo -- "***************************************************************************" }
	if { s6-echo -- "**                        Stage 2 completed                              **" }
	s6-echo -- "***************************************************************************" 
}
redirfd -w 1 /dev/console
s6-echo "Something wrong on stage2, log to debug it"
As you can see, this file is very very small :). So now the things goes to complexity ( a little ).

S6-rc is used to manage a dependencies of service tree. It means, we need to do some things before other, e.g. verify if all the mountpoint exist before doing anything else.
All the service for doing this can be found in /etc/s6/boot-rc-serv. The work about service tree is made "offline", then s6-rc-compile is called to make a database of this work, then s6-svscan control this database. see here http://skarnet.org/software/s6-rc/overview.html.
So, on every directory under /etc/s6/boot-rc-serv content a serie of file to properly start a service.

We have "3 sort of service" :
longrun : classic service like udev
oneshot : service is started one time
bundle : a list of services

for the longrun we need to define those file :
type : type of the service, in this case longrun
run : like runit. So this file can be replaced by runit run file, if you want, or call an another file etc etc.
finish : like runit ( can be empty )
dependencies : this file contents the service that need to be launched before the service itself. This file can be exist or not depends of the purpose.
and another : please see here http://skarnet.org/software/s6-rc/s6-rc-compile.html

for the oneshot we need to define those file :
type : type of the service, in this case oneshot
up : what is made on start
down : what is made on stop ( can be empty )
dependencies : this file contents the service that need to be launched before the service itself
and another : .....

for the bundle we need to define those files :
type : type of the service, in this case bundle
contents : the list of the service which will started

The better is to take a look on boot-rc-serv directory :) for understanding the things

Well, on runit all the service in made on /etc/sv then symlinks are created to /var/service to enable the service. This is a little different on S6. Those directories /etc/s6/boot-serv, /etc/s6/compiled/some_database (compiled database of boot-rc-serv) are entirely copied as it on the directory /run/boot. So, in fact, the working directory is never modified on running time (better for security reason).

Some explanation about /etc/s6/boot-rc-serv directory :

This directory concerns the off works about service.

The first directory called is "All" by the command "s6-rc -u change All".
All :
This is a bundle named service.
The file "contents" is the list of the services started.
Those names may be : a another bundle e.g. all-Boot or service
Those names can be : a services or an another bundle.

To better clarity, a "code name" was created :
a name beginning by a majuscule signify that's a bundle e.g : "All"
a name beginning by the name of a bundle signify that's the service/bundle is declared onto the bundle name e.g. : all-Boot. all-Boot depends of bundle All.
a name beginning by the name of a bundle AND the name after the underscore begin by a majuscule, signify that's a another bundle e.g : all-Boot is a dependency of bundle All and it's a bundle itself.

With this principle, we can see quickly who depends of who e.g : rofs-console depends of the bundle boot-Rofs which depends of all-Boot bundle which depends of All bundles. With a little practice it can be easy :).
The bundle all-Boot concerns all the services/bundles needed to boot the system properly, DO NOT TOUCH THIS BUNDLE if you don't know what you are doing.

Normaly, you don't need to touch anything on this directory. Change some things on it can broke the boot procedure if you don't know what you do.

Some explanation about /etc/s6-serv/ directory :

We have at /etc/s6-serv two folder : available and enabled.
The folder available is used by pacman to install xxx-s6serv or xxx-s6rcserv package.
The folder available contains two sub-directories : classic and rc. Classic contains classic service coming from xxx-s6serv packages. Rc contains rc service coming from xxx-s6rcserv packages.

The folder enabled is used by an user to create a database compilation source of services or enable a classic service.
This folder contains two sub-directories : classic and rc.
classic folder is used to enable a classic service at boot time. This is simple copy of a classic service found on /etc/s6-serv/avaivable/classic/name_of_service
rc contains two sub-directory : source and compiled.
source : this directory is used to prepare a rc service database before compile it.
compiled : this directory is used to store and use a compiled rc service database from the directory source. We have two symlinks on it : current, previous. NEVER ERASE these symlinks. Those symlinks are used by s6opts to know what is the current and previous database before compiling or switching the live database

about s6.conf :

The file can be found in /etc/s6/s6.conf. So these is the file which must be modified if needed (e.g. keymap).
During boot time, s6.conf is parsed and written on multiple file (one by variable) at /run/s6-conf/.
When a service need to read a variable, it goes to /etc/s6/env/s6-conf which is a symlink pointing to /run/s6-conf.

about s6.local :
The file can be found in /etc/s6/data/scripts/s6.local. This file is the same rc.local for runit. A symlinks exist on /etc/s6.local.
This file is launched before starting any user service
a month later
hello mariareese,

Can you be more precise about the crash?
When it happens?
Can you reproduce the problem constantly or the crach occurs from time to time?
What is the output of the uncaught-log when the crash occurs?
The crash concern the boot or a service?

Well, without a minimum of description of the problem, it's impossible to help you. :)
2 months later
good news, i would like to see s6 in alpinelinux.
alpinelinux currently running openrc.
I think a precision of my part is needed here :

First at all, Runit and S6 are not competitor, better; runit and s6 are differents. The manner to work with us is different, mostly on technical part. I mean, the same feature do not have the same syntax and manner to apply, but the results is the same.

The choice is made in function of the needed. It's like choosing between runit and systemd or s6 and systemd. All those programs provide some functionnalities and manner to make it.
As supporters of various init system "philosophies" seem to mistake this page as a place for their political agendas, we've cleared this page and disabled editing.
Editors of the main comparison article are reminded to keep a neutral point of view
i am absolutly agree with this (come from https://wiki.gentoo.org/wiki/Talk:Comparison_of_init_systems), and i must precise that Runit AND S6 are two excellent system, and do what they need to do.
Well some time (all the time :p ), my son is better than another. Do not despise you, i'm wrong another children can be better than mine ;)
8 days later

Powered by Obarun