Browse Source

Update of configurations and documentations

master
Dashie der otter 2 years ago
parent
commit
c9c3fc7436
Signed by: Dashie <dashie@sigpipe.me> GPG Key ID: C2D57B325840B755
5 changed files with 53 additions and 73 deletions
  1. 40
    0
      MAIN_CONFIG.md
  2. 5
    8
      README.md
  3. 7
    11
      SERVICES.md
  4. 0
    53
      TODO.md
  5. 1
    1
      lutrainit/config.go

+ 40
- 0
MAIN_CONFIG.md View File

@@ -0,0 +1,40 @@
# /etc/lutrainit/lutra.conf
INI style configuration.

[global]
; Should lutrainit persist after last tty exit ?
persist=true
; If you want auto login set the following line with any user
; For multiple user (one per tty) or non-autologin tty separate them with a ,
; One tty, no autologin
; autologin=
; Two tty, first autologin, second non-autologin
; autologin=kiosk,
; six non-autologin ttys
autologin=,,,,,
[logging]
filename=/var/log/lutrainit.log
; This enables automated log rotate (switch of following options)
rotate = true
; Segment log daily
rotate_daily = true
; Max size shift of single file, default is 28 means 1 << 28, 256MB
max_size_shift = 28
; Max line number of single file
max_lines = 1000000
; Expired days of log file (delete after max days)
max_days = 7
## Default values
- persist: true
- autologin: ,
- two non-autologin ttys (tty1 and tty2)
- logging
- filename: /var/log/lutrainit.log
- rotate: true
- rotate_daily: true
- max_size_shift: 28
- max_lines: 1000000
- max_days: 7

+ 5
- 8
README.md View File

@@ -1,17 +1,14 @@
# lutrainit

lutrainit is a simple init system for Linux written in Go.

It's likely less full-featured and more minimalist than your init system. (It aims to be an init system and only an init system.)
lutrainit is an init system for Linux written in Go.

lutrainit will do the following:

1. Set the hostname
2. Remount the root filesystem[1]
3. Mount all other non-network filesystems and activate swap partitions
3. Start processes with config files in /etc/dainit after their dependencies
("Needs") are started. See `conf/` for a sample udevd and wpa_supplicant (which
depends on udevd to finish before being started) config.
3. Start processes with config files in /etc/lutrainit/lutra.d/ after their dependencies
("Needs") are started. See `conf/` for a samples config.
4. Start some TTY or anything other user-specified.
5. Kill running processes, unmount filesystems, and poweroff the system once that last
login session ends.
@@ -21,10 +18,10 @@ many slow startup processes.)

You can also create a file `/etc/lutrainit/lutra.conf` for some basic configuration.

If there are any lines of the form `Autologin: username` it will automatically log in
If there are any lines of the form `autologin: username` it will automatically log in
as that username. (If there's multiple autologin directives, it will create the
appropriate number of ttys.)
If any line contains `Persist: true`, then when a tty exits, it'll respawn the tty instead of powering down the system once all the ttys are gone.
If any line contains `persist: true`, then when a tty exits, it'll respawn the tty instead of powering down the system once all the ttys are gone.

See the `conf/` folder for what you can put in `/etc/lutrainit/` including services files in `/etc/lutrainit/lutra.d/`.


CONFIGURATION.md → SERVICES.md View File

@@ -1,12 +1,3 @@
# /etc/lutrainit/lutra.conf

# Should lutrainit persist after last tty exit ?
Persist: true/false
# Adds as many as you want of Autologin, any line will create a TTY with specified user auto-logged
Autologin: foo
Autologin: root
# /etc/lutrainit/lutra.d/
## foo.service

@@ -41,12 +32,17 @@
Separate multiples keywords with `,`. Only a-Z0-9 - and _ allowed
- Startup: One line command to start service
- Shutdown: One line command to stop service
- CheckAlive: One line command to check if service is alive, however it use PIDFile
- PIDFile: Where does the forking service sore his PID ?
- Autostart: true/false, will the service started on boot ?
- Type:
- simple: service doesn't expect to fork by himself
- forking: service is expected to fork by himself, PIDFile: filled would be great
- oneshot: expected to fork by himself, no stop/status possible, it's a one-shot thing
Provides are mandatory, you can just put here the Name of the service.

Needs are used for relationship, like udev can only be started when loopback have been brought up.
Needs are used for relationship, like udev can only be started when loopback have been brought up.

## Default values
- Autostart: true
- Type: forking

+ 0
- 53
TODO.md View File

@@ -1,53 +0,0 @@
# TO DO

## Tests
Add more tests

## Documentation

To be improved, code itself or external.

## Userland tool controller

ATM it seems that the init only starts services and that's all.

Introducing lutrinactl, using some socket like /var/otterland would permit to do the following:

- Services status
- Service start,stop,restart,status
- Init itself statistics (Go GC stats, memory, etc.)

## Process reload

An init like SySVInit or SystemD can reload itself using 'telinit u' or other command.

What would we need to do in Go to achieve the same result ?

Init shouldn't be killed, and would reuse PID1 then.

## Logging

Would be great to add better logging, verbose or not, file after / rw,remount.

## Getty improvements

Use some "special" config file for that.

Maybe treat them like systemd with a getty.whatever file.

## FS Mounts/umount

To be improved, more checks or support.

## Services files improvements

What | Working on | Done
------|------------|------
PreExec | | |
PostExec | | |
Retry | | |
Timeout ? | | |

## Socket Activation

Basic socket activation, is it possible using Go ?

+ 1
- 1
lutrainit/config.go View File

@@ -214,7 +214,7 @@ func ParseSetupConfig(fname string) (err error) {
Cfg.NameMapper = ini.TitleUnderscore

sec := Cfg.Section("global")
MainConfig.Persist = sec.Key("Persist").MustBool(false)
MainConfig.Persist = sec.Key("Persist").MustBool(true)
MainConfig.Autologins = sec.Key("Autologin").Strings(",")

sec = Cfg.Section("logging")

Loading…
Cancel
Save