-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from mobinmob/devel
merge devel branch for v.0.0.2
- Loading branch information
Showing
18 changed files
with
285 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# 66 | ||
|
||
## 1. Overview | ||
|
||
> 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. | ||
[project page](https://web.obarun.org/software/66/v0.6.0.0/) | ||
|
||
66 manages services in trees, which are collections of services, analogous to runlevels or targets in other init systems/service managers. | ||
|
||
|
||
## 2. Installation | ||
|
||
- 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. | ||
|
||
`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. | ||
The package also contains some scripts written in order to make the services work for Void Linux. | ||
|
||
`void-66-services` contains service frontend files for Void Linux. | ||
|
||
|
||
## 3. Configuration | ||
|
||
There are two ways to create the recommended basic trees for 66, an automatic and a manual one. The automatic configuration is **strongly** recommended. | ||
|
||
### 3.1. Automatic configuration | ||
|
||
- Run the `66boot-initial-setup` script: | ||
|
||
_(commands prefixed by # are given with elevated privileges - as root)_ | ||
``` | ||
# 66boot-initial-setup | ||
``` | ||
|
||
The script creates the necessary trees, enables in them some services and created the target for the basic configuration file symlink. | ||
|
||
|
||
### 3.2 Manual configuration | ||
|
||
#### 3.2.1 The `boot` tree | ||
|
||
- Create a mandatory **n**ew tree `boot` and enable the boot@system service in it: | ||
_(commands prefixed by # are given with elevated privileges - as root)_ | ||
``` | ||
# 66-tree -n boot | ||
# 66-enable -F -t boot boot@system | ||
``` | ||
- Create a permanent boot@system configuration file: | ||
``` | ||
# cp /etc/66/conf/boot@system/version/.boot@system /etc/66/conf/boot@system/version/boot@system | ||
``` | ||
|
||
#### 3.2.2 The `default` tree | ||
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. | ||
|
||
- Create the **n**ew tree, **E**nable it and make it **c**urrent: | ||
|
||
``` | ||
# 66-tree -nEc default | ||
``` | ||
|
||
- Enable services in the new tree -the switch-initutils services is recommended: | ||
``` | ||
# 66-enable switch-initutils | ||
``` | ||
|
||
#### 3.2.3 Using runit services | ||
|
||
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. | ||
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: | ||
|
||
``` | ||
# 66-tree -nE runit | ||
# 66-enable -t runit runit | ||
# 66-tree -S default runit | ||
``` | ||
|
||
The runit services are started the normal way, by symlinking the service directories under /var/service/. | ||
|
||
|
||
### 3.3 Finalising configuration | ||
|
||
Both methods lead to the same basic trees created and services enabled. But before changing the init system, some more configuration must happen. | ||
|
||
- Edit the **/etc/66rc.conf** with a text editor, save it and re-enable the `boot@system` service file in the `boot` tree: | ||
|
||
``` | ||
# 66-enable -t boot -F boot@system | ||
``` | ||
|
||
Please consult the `boot@` man page and the comments of the configuration file. Wrong configuration can result in an unbootable or problematic system! | ||
|
||
### 3.4 Switching to 66 from runit | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Template file for 'void-66-services-devel' | ||
pkgname=void-66-services-devel | ||
version=0.0.0.devel | ||
revision=1 | ||
wrksrc=void-66-services | ||
hostmakedepends="git" | ||
depends="66" | ||
short_desc="66 service frontend files for voidlinux" | ||
maintainer="mobinmob <[email protected]>" | ||
license="BSD-2-Clause" | ||
homepage="https://github.com/mobinmob/void-66-services/" | ||
replaces="void-66-services>=0 void-66-services-master>=0" | ||
|
||
do_fetch() { | ||
git clone https://github.com/mobinmob/void-66-services ${wkrsrc} | ||
cd ${wrksrc} | ||
git checkout devel | ||
} | ||
|
||
do_install() { | ||
vmkdir usr | ||
vcopy usr / | ||
chmod +x "${DESTDIR}/usr/share/66/service/dbus/data/check" | ||
vlicense LICENSE | ||
vlicense AUTHORS | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Template file for 'void-66-services-master' | ||
pkgname=void-66-services-master | ||
version=0.0.0.master | ||
revision=1 | ||
wrksrc=void-66-services | ||
hostmakedepends="git" | ||
depends="66" | ||
short_desc="66 service frontend files for voidlinux" | ||
maintainer="mobinmob <[email protected]>" | ||
license="BSD-2-Clause" | ||
homepage="https://github.com/mobinmob/void-66-services/" | ||
replaces="void-66-services>=0 void-66-services-devel>=0" | ||
|
||
do_fetch() { | ||
git clone https://github.com/mobinmob/void-66-services ${wkrsrc} | ||
} | ||
|
||
do_install() { | ||
vmkdir usr | ||
vcopy usr / | ||
chmod +x "${DESTDIR}/usr/share/66/service/dbus/data/check" | ||
vlicense LICENSE | ||
vlicense AUTHORS | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[main] | ||
@type = oneshot | ||
@version = 0.0.1 | ||
@description = "asus keyboard backlight control" | ||
@user = ( root ) | ||
|
||
[start] | ||
@execute = ( asus-kbd-backlight allowusers ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
exec dbus-send --system / org.freedesktop.DBus.Peer.Ping > /dev/null 2> /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
[main] | ||
@type = longrun | ||
@version = 0.0.1 | ||
@version = 0.0.2 | ||
@description = "dbus system daemon" | ||
@user = ( root ) | ||
@maxdeath = 3 | ||
@notify = 4 | ||
@options = ( log ) | ||
@timeout-up = 6000 | ||
@notify = 3 | ||
@hiercopy = ( data ) | ||
|
||
[start] | ||
@execute = ( | ||
execl-toc -d /run/dbus -m 755 -g 22 -u 22 | ||
dbus-daemon --nofork --nopidfile --system --print-pid=4 | ||
exec s6-notifyoncheck dbus-daemon --nofork --system --nopidfile | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
[main] | ||
@type = classic | ||
@description = "dcron daemon" | ||
@version = 0.0.1 | ||
@version = 0.0.2 | ||
@user = ( root ) | ||
@options = ( log ) | ||
# https://github.com/dubiousjim/dcron/issues/13 | ||
@flags = ( nosetsid ) | ||
@notify = 3 | ||
|
||
[start] | ||
@execute = ( dcrond -f ) | ||
|
||
|
||
# https://github.com/dubiousjim/dcron/issues/13 | ||
@execute = ( 66-ns -d 3 -o unshare=pid dcrond -f ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[main] | ||
@type = oneshot | ||
@version = 0.0.1 | ||
@description = "control drbd" | ||
@user = ( root ) | ||
|
||
[start] | ||
@execute = ( /usr/libexec/drbd start ) | ||
|
||
[stop] | ||
@execute = ( /usr/libexec/drbd stop ) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[main] | ||
@type = oneshot | ||
@version = 0.0.1 | ||
@description = "control firehol" | ||
@user = ( root ) | ||
|
||
[start] | ||
@execute = ( execl-toc -e /etc/firehol/firehol.conf | ||
firehol start ) | ||
|
||
[stop] | ||
@execute = ( firehol stop ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[main] | ||
@type = oneshot | ||
@version = 0.0.1 | ||
@description = "laptop mode" | ||
@user = ( root ) | ||
|
||
[start] | ||
@execute = ( laptop_mode init auto ) | ||
|
||
[stop] | ||
@execute = ( laptop_mode init stop ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[main] | ||
@type = oneshot | ||
@version = 0.0.1 | ||
@description = "lxc autostart" | ||
@user = ( root ) | ||
|
||
[start] | ||
@execute = ( lxc-autostart ) | ||
|
||
[stop] | ||
@execute = ( lxc-autostart -s -t 15 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[main] | ||
@type = oneshot | ||
@version = 0.0.1 | ||
@description = "odroid led control" | ||
@user = ( root ) | ||
|
||
[start] | ||
@execute = ( odroid-led ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[main] | ||
@type = oneshot | ||
@version = 0.0.1 | ||
@description = "shorewall gateway-firewall configuration tool" | ||
@user = ( root ) | ||
|
||
[start] | ||
@execute = ( shorewall start ) | ||
|
||
[stop] | ||
@execute = ( shorewall stop ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[main] | ||
@type = oneshot | ||
@version = 0.0.1 | ||
@description = "shorewall gateway-firewall configuration tool" | ||
@user = ( root ) | ||
|
||
[start] | ||
@execute = ( shorewall6 start ) | ||
|
||
[stop] | ||
@execute = ( shorewall6 stop ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[main] | ||
@type = oneshot | ||
@version = 0.0.1 | ||
@description = "control tlp - advanced power management tool" | ||
@user = ( root ) | ||
|
||
[start] | ||
@execute = ( tlp init start ) | ||
|
||
[stop] | ||
@execute = ( tlp init stop ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
[main] | ||
@type = oneshot | ||
@version = 0.0.1 | ||
@version = 0.0.2 | ||
@description = "Manage zram swap space" | ||
@user = ( root ) | ||
@options = ( log ) | ||
|
||
[start] | ||
@build=custom | ||
@shebang = "/bin/sh -c" | ||
@execute = ( | ||
#export ZRAM_COMP_ALGORITHM=lz4 | ||
#export ZRAM_PRIORITY=32767 | ||
#export ZRAM_SIZE=25 | ||
#export ZRAM_STREAMS=1 | ||
zramen make ) | ||
execl-cmdline -s { | ||
export ZRAM_COMP_ALGORITHM ${ZRAM_COMP_ALGORITHM} | ||
export ZRAM_PRIORITY ${ZRAM_PRIORITY} | ||
export ZRAM_SIZE ${ZRAM_SIZE} | ||
export ZRAM_STREAMS ${ZRAM_STREAMS} | ||
zramen make } | ||
) | ||
|
||
[stop] | ||
@execute = ( zramen toss ) | ||
|
||
[environment] | ||
ZRAM_COMP_ALGORITHM=lz4 | ||
ZRAM_PRIORITY=32767 | ||
ZRAM_SIZE=25 | ||
ZRAM_STREAMS=1 |