Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have compiled a custom linux kernel in BusyBox. BusyBox init does not support runlevels. When the kernel boots up in BusyBox, it first executes init which looks for the specified runlevel in /etc/inittab. BusyBox init works just fine without /etc/inittab. When no inittab is found it has the following behavior:


This part is very clear to me, but I would like to know how to manage daemons that start up networking, create serial ports, or start java processes. I have looked in the scripts that reside in /etc/init.d/ but I don't understand how to manage them. I am looking for a good tutorial or solution to control these services myself without an automated tool like buildroot. I want to understand how these scripts work and how to create devices in /dev/ (right now I only have console and ttyAM0).

share|improve this question
up vote 4 down vote accepted

For buildroot all your scripts must be placed in $path_to_buildroot/output/target/etc/init.d before build image. In my case this directory contains rcS and few scripts named S[0-99]script_name. So you can create your own start\stop script.



    # Start all init scripts in /etc/init.d
    # executing them in numerical order.
    for i in /etc/init.d/S??* ;do

         # Ignore dangling symlinks (if any).
         [ ! -f "$i" ] && continue

         case "$i" in
            # Source shell script for speed.
            trap - INT QUIT TSTP
            set start
            . $i
            # No sh extension, so fork subprocess.
            $i start

and for example S40network:

# Start the network....

case "$1" in
    echo "Starting network..."
    /sbin/ifup -a
    echo -n "Stopping network..."
    /sbin/ifdown -a
    "$0" stop
    "$0" start
    echo $"Usage: $0 {start|stop|restart}"
    exit 1

exit $?
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.