Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am a beginner in embedded Linux, I have compiled the kernel without initramfs and kernel is booting fine. But It shows me rcS file is not found I have put it in /etc/init.d/rcS and my rcS file look like

#!/bin/sh
echo "Hello world"

After the file system is mounted by the kernel it prints Hello world.

Can any one tell/explain me why this file is require and how could I start those start up scripts in particular order?

I am using Raspberry Pi with busybox and it works fine but get I got stuck in the startup. Please help me out.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

/etc/init.d/rcS allows you to run additional programs at boot time. Its typical use is to mount additional filesystems (only the root filesystem is mounted at that point) and launch some daemons.

Usually rcS is a shell script, which can easily be customized on the fly. Typical distributions make rcS a simple script that executes further scripts in /etc/rcS.d (the exact location is distribution-dependent); this allows each daemon to be package with its own init script. The file /etc/rc.local is also executed by rcS if present; it is intended for commands written by the system administrator.

With the traditional SysVinit implementation of init, /etc/init.d/rcS is listed in /etc/inittab (the sysinit setting). With BusyBox, you can also supply an inittab (if the feature is compiled in) but there is a built-in default that makes it read /etc/init.d/rcS (among other things).

share|improve this answer
    
great, Its very helpful to me ... Thanks @Gilles –  Shantanu Banerjee Nov 20 '12 at 4:37

/etc/init.d/rcS generally kicks off the scripts in /etc/rcS.d/

here's mine:

$ cat /etc/init.d/rcS
#! /bin/sh
#
# rcS
#
# Call all S??* scripts in /etc/rcS.d/ in numerical/alphabetical order
#

exec /etc/init.d/rc S


$ ls /etc/rcS.d/
README  S25brltty  S37apparmor  S55urandom  S70x11-common
share|improve this answer

Your Answer

 
discard

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.