kisscommunity

kisscommunity.bvnf.space site sources
git clone git://bvnf.space/home/kiss/kisscommunity.git
Log | Files | Refs | Submodules | README | LICENSE

index.md (4482B)


      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
MANAGING SERVICES WITH BUSYBOX
==============================

KISS uses busybox's init with busybox's runit utilities for services by default.


Basic usage
-----------

    +---------+--------------------------------------------------------------------+
    | Action  | Command                                                            |
    |---------+--------------------------------------------------------------------|
    | List    | $ ls /etc/sv/                                                      |
    |         |                                                                    |
    | Enable  | $ ln -s /etc/sv/SERVICE_NAME/ /var/service                         |
    | Disable | $ unlink /var/service/SERVICE_NAME                                 |
    |         |                                                                    |
    | Stop    | $ sv down   SERVICE_NAME                                           |
    | Start   | $ sv up     SERVICE_NAME                                           |
    | Status  | $ sv status SERVICE_NAME                                           |
    |         |                                                                    |
    +---------+--------------------------------------------------------------------+

See <https://git.busybox.net/busybox/tree/runit/sv.c> for full usage.


Running commands during boot/shutdown
-------------------------------------

This can be accomplished in a generic way (using /etc/rc.d) or by modifying the
busybox-init only /etc/inittab file.


### Using /etc/rc.d

This method of configuration works with every init system which uses the
KISS init framework. See <https://github.com/kisslinux/init>

    +--------------------------------------------------------------------------+
    | Run command during boot.                                                 |
    +--------------------------------------------------------------------------+
    |                                                                          |
    |  # Load the iwlwifi kernel module.                                       |
    |  echo "modprobe iwlwifi" > /etc/rc.d/wifi.boot                           |
    |                                                                          |
    +--------------------------------------------------------------------------+
    | Run command during shutdown.                                             |
    +--------------------------------------------------------------------------+
    |                                                                          |
    |  # Save system time to hwclock.                                          |
    |  echo "hwclock -w" > /etc/rc.d/hwclock.pre.shutdown                      |
    |                                                                          |
    +--------------------------------------------------------------------------+
    |                                                                          |
    |   TIP: .post.shutdown can also be used.                                  |
    |                                                                          |
    +--------------------------------------------------------------------------+


### Using /etc/inittab

    +--------------------------------------------------------------------------+
    | Run command during boot.                                                 |
    +--------------------------------------------------------------------------+
    |                                                                          |
    |  # Load the iwlwifi kernel module.                                       |
    |  ::once:/bin/modprobe iwlwifi                                            |
    |                                                                          |
    +--------------------------------------------------------------------------+
    | Run command during shutdown.                                             |
    +--------------------------------------------------------------------------+
    |                                                                          |
    |  # Save system time to hwclock.                                          |
    |  ::shutdown:/bin/hwclock -w                                              |
    |                                                                          |
    +--------------------------------------------------------------------------+