OSDN Git Service

conf/void-66-conf.md changes:
[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 separate 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 The `boot-66serv` and `void-66-services` packages are needed to boot and use 66 as init and service manager on voidlinux. 
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  Currently these packages are in a [PR](https://github.com/void-linux/void-packages/pull/25743). In order to install them one can build them from the PR or install them from the unofficial void-66 repo -currently only for x86-64.
22
23  ### 2.1 Installing packages from the void-66 repo.
24  - Add the repo:
25
26 _(commands prefixed by # are given with elevated privileges - as root)_
27  ```
28  # echo "repository=https://codeberg.org/mobinmob/void-66/raw/branch/master" > /etc/xbps.d/50-repository-unofficial-void-66.conf
29  ```
30 - Sync the new repo and accept the sigining key:
31  ```
32  # xbps-install -Sy
33  ```
34
35 You will be prompted to accept the new key:
36 ```
37   https://codeberg.org/mobinmob/void-66/raw/branch/master/ repository has been RSA signed by "mobinmob <mobinmob@disroot.org>"
38 Fingerprint: c7:39:79:a3:2a:cf:f1:65:a6:df:3a:1a:6e:93:36:28
39 Do you want to import this public key? [Y/n] 
40 ```
41 - After accepting it, install the new packages:
42 ```
43 # xbps-install boot-66serv void-66-services
44 ```
45
46
47 ## 3. Configuration
48
49 There are two ways to create the recommended basic trees for 66, an automatic and a manual one. The automatic configuration is **strongly** recommended.
50
51 ### 3.1. Automatic configuration
52
53 - Run the `66boot-initial-setup` script:
54
55 _(commands prefixed by # are given with elevated privileges - as root)_
56 ```
57 # 66boot-initial-setup
58 ```
59
60 The script creates the necessary trees, enables in them some services and created the target for the basic configuration file symlink.
61
62
63 ### 3.2 Manual configuration
64
65 #### 3.2.1 The `boot` tree
66
67 - Create a mandatory **n**ew tree `boot` and enable the boot@system service in it:
68
69 ```
70 # 66-tree -n boot  
71 # 66-enable -F -t boot boot@system
72 ```
73 - Create a permanent boot@system configuration file:
74 ```
75 # cp /etc/66/conf/boot@system/version/.boot@system /etc/66/conf/boot@system/version/boot@system
76 ```
77
78 #### 3.2.2 The `default` tree
79 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.
80
81 - Create the **n**ew tree, **E**nable it and make it **c**urrent:
82
83 ```
84 # 66-tree -nEc default
85 ```
86
87 - Enable services in the new tree -the switch-initutils services is recommended:
88 ```
89 # 66-enable switch-initutils
90 ```
91
92 #### 3.2.3 Using runit services
93
94 66 can work with the existing runit services. That is useful as there are not yet frontend service files for all the packages that have a runit service directory.
95 To use runit services, a separate runit tree can be created, the runit service enabled and started in it and make the tree start after default:
96
97 ```
98 # 66-tree -nE runit
99 # 66-enable -t runit runit
100 # 66-tree -S default runit
101 ```
102
103 The runit services are started the normal way, by symlinking the service directories under /var/service/.
104
105
106 ### 3.3 Finalising configuration
107
108 Both methods lead to the same basic trees created and services enabled. But before changing the init system, some more configuration must happen.
109
110 - Edit **/etc/66rc.conf** with a text editor, save it and re-enable the `boot@system` service file in the `boot` tree:
111
112 _(commands prefixed by # are given with elevated privileges - as root)_
113
114 ```
115 # 66-enable -t boot -F boot@system
116 ```
117
118 Please consult the `boot@` man page and the comments of the configuration file. Wrong configuration can result in an unbootable or problematic system!
119
120 ### 3.4 Switching to 66 from runit
121
122 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 it.