OSDN Git Service

Merge pull request #58 from mobinmob/add_doc
[avyssos/void-66-services.git] / conf / void-66-conf.md
1 # 66
2
3 ## 1. Overview
4
5 > Sixty-six is a collection of system tools built around s6 and s6-rc created to make the implementation and manipulation of service files on your machine easier. It is meant to be a toolbox for the declaration, implementation and administration of services where seperate programs can be joined to achieve powerful functionality with small amounts of code.
6
7 [project page](https://web.obarun.org/software/66/v0.6.0.0/)
8
9 66 manages services in trees, which are collections of services, analogous to runlevels or targets in other init systems/service managers.
10
11
12 ## 2. Installation
13
14 - Install the `boot-66serv` and `void-66-services` packages. Currently these packages are in a [PR](https://github.com/void-linux/void-packages/pull/25743), so one needs to build them first.
15
16 `boot-66serv` contains the `boot@` module service, which, along with other frontend files and scripts, are used for the first stage of booting a system. It is rougly analogous to the runit-void package for runit as it initialises the system (setting hostname, timezone, open luks devices, etc) and starts agetty on tty1-4 by default. The package was created as a portable stage1 for 66 and is used in the [Obarun](http://obarun.org/) distribution.
17 The package also contains some scripts written in order to make the services work for Void Linux.
18
19 `void-66-services` contains service frontend files for Void Linux.
20  
21
22 ## 3. Configuration
23
24 There are two ways to create the recommended basic trees for 66, an automatic and a manual one. The automatic configuration is **strongly** recommended.
25
26 ### 3.1. Automatic configuration
27
28 - Run the `66boot-initial-setup` script:
29
30 _(commands prefixed by #  are given with elevated provileges - as root)_
31 ```
32 # 66boot-initial-setup
33 ```
34
35 The script creates the neccessary trees, enables in them some services and created the target for the basic configuration file symlink.
36
37
38 ### 3.2 Manual configuration
39
40 #### 3.2.1 The `boot` tree
41
42 - Create a mandatory **n**ew tree `boot` and enable the boot@system service in it:
43 _(commands prefixed by #  are given with elevated provileges - as root)_
44 ```
45 # 66-tree -n boot  
46 # 66-enable -F -t boot boot@system
47 ```
48 - Create a permanent boot@system configuration file:
49 ```
50 # cp /etc/66/conf/boot@system/version/.boot@system /etc/66/conf/boot@system/version/boot@system
51 ```
52
53 #### 3.2.2 The `default` tree
54 More services can be enabled in a different tree, that starts after the boot tree. **default** is a nice name for it, as it is used for the... default collection of services in void.
55
56 - Create the **n**ew tree, **E**nable it and make it **c**urrent:
57
58 ```
59 # 66-tree -nEc default
60 ```
61
62 - Enable services in the new tree -the switch-initutils services is recommended:
63 ```
64 # 66-enable switch-initutils
65 ```
66
67 #### 3.2.3 Using runit services
68
69 66 can work with the existing runit services. That is usefull as there are not yet frontend service files for all the packages that have a runit service directory.
70 To use runit services, a seperate runit tree can be created, the runit service enabled and started in it and make the tree start after default:
71
72 ```
73 # 66-tree -nE runit
74 # 66-enable -t runit runit
75 # 66-tree -S default runit
76 ```
77
78 The runit services are started the normal way, by symlinking the service directories under /var/service/.
79
80
81 ### 3.3 Finalising configuration
82
83 Both methods lead to the same basic trees created and services enabled. But before changing the init system, some more configuration must happer.
84
85 - Edit the **/etc/66rc.conf** with a text editor, save it and re-enable the `boot@system` service file in the `boot` tree:
86
87 ```
88 # 66-enable -t boot -F boot@system
89 ```
90
91 Please consult the `boot@` man page and the comments of the configuration file. Wrong configuration can result in an unbootable or problematic system!
92
93 ### 3.4 Switching to 66 from runit
94
95 To boot the system with 66 instead of runit after the configuration, you just add `init=/usr/bin/66` to the kernel commandline. To switch back, remove the line.