Rc script
Jump to navigation
Jump to search
RC-Scripts are scripts that define the basic functions of each service, as well as each service's dependencies for start-up. The RC-Scripts often live in /etc/init.d/, but on some systems may live in /etc/rc.d.
Here is the general layout of an RC-Script:
#!/sbin/runscript
depend() {
need bar
}
start() {
ebegin "Starting foo"
/sbin/foo
eend $? "Failed to start foo"
}
stop() {
ebegin "Stopping foo"
kill $(cat /var/run/foo.pid)
eend $? "Failed to stop foo"
}
See also
- Services
- Run levels
- Scheduling Tasks - how to create System V init scripts
External links
- For more about RC-Scripts under Gentoo (www.gentoo.org)