|/
|\ISS LINUX™

News (20210723a)
Blog
Install
FAQ
Wiki
Package System
Package Manager
Testimonials
Screenshots
Contact
Donate
Archive
wiki / init / busybox                                             Edit this page
Edited (545e983) at 2023-07-07 by sdsddsd1
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                                             |
|         |                                                                    |
+---------+--------------------------------------------------------------------+
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 $/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                                              |
    |                                                                          |
    +--------------------------------------------------------------------------+
________________________________________________________________________________
Dylan Araps (C) 2019-2021
The registered trademark Linux(R) is used pursuant to a sublicense from the
Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark
on a world­wide basis.