Codebase list openrc / a689b66
Add tunable SYSCONFDIR Roy Marples 16 years ago
34 changed file(s) with 65 addition(s) and 64 deletion(s). Raw diff Collapse all Expand all
0 DIR= /etc/conf.d
0 DIR= ${CONFDIR}
11 CONF= bootmisc clock fsck hostname local net urandom
22
33 MK= ../mk
0 # /etc/conf.d/bootmisc
1
20 # Put a nologin file in /etc to prevent people from logging in before
31 # system startup is complete
42 delay_login="NO"
0 # /etc/conf.d/clock
1
20 # Set CLOCK to "UTC" if your system clock is set to UTC (also known as
31 # Greenwich Mean Time). If your clock is set to the local time, then
42 # set CLOCK to "local". Note that if you dual boot with Windows, then
0 # /etc/conf.d/urandom
1
20 # Sometimes you want to have urandom start before "localmount"
31 # (say for crypt swap), so you will need to customize this
42 # behavior. If you have /var on a separate partition, then
0 DIR= /etc/conf.d
0 DIR= ${CONFDIR}
11 CONF= localmount moused powerd rarpd
22
33 MK= ../mk
0 # /etc/conf.d/localmount
1
20 # Kernel core dump options for FreeBSD kernel.
31 # Unless you're a FreeBSD kernel developer or driver writer then this won't
42 # be of any interest to you at all.
0 DIR= /etc/conf.d
0 DIR= ${CONFDIR}
11 CONF= syscons
22
33 MK= ../mk
0 DIR= /etc/conf.d
0 DIR= ${CONFDIR}
11 CONF= consolefont keymaps modules
22 CONF_APPEND= clock
33
0 # /etc/conf.d/consolefont
1
20 # consolefont specifies the default font that you'd like Linux to use on the
31 # console. You can find a good selection of fonts in /usr/share/consolefonts;
42 # you shouldn't specify the trailing ".psf.gz", just the font name below.
0 # /etc/conf.d/keymaps
1
20 # Use KEYMAP to specify the default console keymap. There is a complete tree
31 # of keymaps in /usr/share/keymaps to choose from.
42 keymap="us"
0 DIR= /etc
0 DIR= ${SYSCONFDIR}
11 CONF= rc.conf
22
33 MK= ../mk
0 # /etc/rc.conf: Global OpenRC configuration settings
0 # Global OpenRC configuration settings
11
22 # Set to "YES" if you want the rc system to try and start services
33 # in parallel for a slight speed improvement. When running in parallel we
0 DIR= /etc
0 DIR= ${SYSCONFDIR}
11 CONF= rc rc.shutdown
22
33 MK= ../mk
0 DIR= /etc
0 DIR= ${SYSCONFDIR}
11 CONF_APPEND= rc.conf
22
33 MK= ../mk
0 DIR= /etc/init.d
0 DIR= ${INITDIR}
11 SRCS= bootmisc.in fsck.in halt.sh.in hostname.in local.in localmount.in \
22 netmount.in root.in swap.in urandom.in
33 BIN= ${OBJS}
11 # Copyright 2007-2008 Roy Marples <roy@marples.name>
22 # All rights reserved. Released under the 2-clause BSD license.
33
4 . /etc/init.d/functions.sh
4 . /@SYSCONFDIR@/init.d/functions.sh
55 . "${RC_LIBDIR}"/sh/rc-functions.sh
6 [ -r /etc/rc.conf ] && . /etc/rc.conf
6 [ -r @SYSCONFDIR@/rc.conf ] && . @SYSCONFDIR@/rc.conf
77
88 # Support LiveCD foo
99 if [ -r /sbin/livecd-functions.sh ]; then
2727 # 1) we don't need (and by default can't) umount anything (VServer) or
2828 # 2) the host utils take care of all umounting stuff (OpenVZ)
2929 if [ "${RC_SYS}" = "VSERVER" -o "${RC_SYS}" = "OPENVZ" ]; then
30 if [ -e /etc/init.d/"$1".sh ]; then
31 . /etc/init.d/"$1".sh
30 if [ -e @SYSCONFDIR@/init.d/"$1".sh ]; then
31 . @SYSCONFDIR@/init.d/"$1".sh
3232 else
3333 exit 0
3434 fi
9292 fi
9393
9494 # Load the final script - not needed on BSD so they should not exist
95 [ -e /etc/init.d/"$1".sh ] && . /etc/init.d/"$1".sh
95 [ -e @SYSCONFDIR@/init.d/"$1".sh ] && . @SYSCONFDIR@/init.d/"$1".sh
9696
9797 # Always exit 0 here
9898 exit 0
1818 fi
1919
2020 # Support old configs
21 if [ -e /etc/conf.d/local.start ]; then
22 . /etc/conf.d/local.start
21 if [ -e @SYSCONFDIR@/conf.d/local.start ]; then
22 . @SYSCONFDIR@/conf.d/local.start
2323 fi
2424
2525 eend $? "Failed to start local"
3434 fi
3535
3636 # Support old configs
37 if [ -e /etc/conf.d/local.stop ]; then
38 . /etc/conf.d/local.stop
37 if [ -e @SYSCONFDIR@/conf.d/local.stop ]; then
38 . @SYSCONFDIR@/conf.d/local.stop
3939 fi
4040
4141 eend $? $"Failed to stop local"
2525 local pmap=""
2626 if need_portmap; then
2727 pmap="${pmap} rpc.statd"
28 [ -x /etc/init.d/rpcbind ] \
28 [ -x @SYSCONFDIR@/init.d/rpcbind ] \
2929 && pmap="rpcbind" \
3030 || pmap="portmap"
3131 fi
3939 start()
4040 {
4141 local myneed= myuse= pmap="portmap" nfsmounts=
42 [ -x /etc/init.d/rpcbind ] && pmap="rpcbind"
42 [ -x @SYSCONFDIR@/init.d/rpcbind ] && pmap="rpcbind"
4343
4444 local x= fs=
4545 for x in ${net_fs_list}; do
0 DIR= /etc/init.d
0 DIR= ${INITDIR}
11 SRCS= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
22 rpcbind.in savecore.in sysctl.in syslogd.in
33 BIN= ${OBJS}
1313 {
1414 ebegin "Starting local rc services"
1515 local svc= enabled= retval=0 service=
16 for svc in $(rcorder /etc/rc.d/* /usr/local/etc/rc.d/* 2>/dev/null); do
16 for svc in $(rcorder /etc/rc.d/* @PKG_PREFIX@/etc/rc.d/* 2>/dev/null); do
1717 [ -x "$svc" ] || continue
1818 service=${svc##*/}
1919
2323 done
2424
2525 # If we have an init script for this service, continue
26 [ -x /etc/init.d/"${service}" ] && continue
27 [ -x /usr/local/etc/init.d/"${service}" ] && continue
26 [ -x @SYSCONFDIR@/init.d/"${service}" ] && continue
27 [ -x @PKG_PREFIX@/@SYSCONFDIR@/init.d/"${service}" ] && continue
28 [ -x @LOCAL_PREFIX@/@SYSCONFDIR@/init.d/"${service}" ] && continue
2829
2930 # Ensure that the users rc.conf will start us - ignore the defaults
3031 eval enabled=\$${svc##*/}_enable
0 DIR= /etc/init.d
0 DIR= ${INITDIR}
11 SRCS= clock.in devd.in dumpon.in ipfw.in mixer.in nscd.in powerd.in syscons.in
22 BIN= ${OBJS}
33
0 DIR= /etc/init.d
0 DIR= ${INITDIR}
11 SRCS= clock.in consolefont.in keymaps.in modules.in mtab.in numlock.in \
22 procfs.in sysctl.in
33 BIN=${OBJS}
0 DIR= /etc/init.d
0 DIR= ${INITDIR}
11 SRCS= swap-blk.in ttys.in wscons.in
22 BIN= ${OBJS}
33
0 DIR= /etc/init.d
0 DIR= ${INITDIR}
11 SRCS= avahi-dnsconfd.in avahid.in dbus.in hald.in named.in ntpd.in \
22 openvpn.in polkitd.in sshd.in
33
55
66 OBJS+= ${SRCS:.in=}
77
8 _SED_REPLACE= -e 's:@SHELL@:${SH}:g' -e 's:@LIB@:${LIBNAME}:g' -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' -e 's:@PREFIX@:${PREFIX}:g' -e 's:@PKG_PREFIX@:${PKG_PREFIX}:g' -e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g'
9
810 # Tweak our shell scripts
911 .SUFFIXES: .sh.in .in
1012 .sh.in.sh:
11 sed -e 's:@SHELL@:${SH}:g' -e 's:@LIB@:${LIBNAME}:g' -e 's:@PREFIX@:${PREFIX}:g' -e 's:@PKG_PREFIX@:${PKG_PREFIX}:g' -e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g' $< > $@
13 sed ${_SED_REPLACE} $< > $@
1214
1315 .in:
14 sed -e 's:@PREFIX@:${PREFIX}:g' -e 's:@PKG_PREFIX@:${PKG_PREFIX}:g' -e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g' $< > $@
16 sed ${_SED_REPLACE} $< > $@
1517
1618 all: ${OBJS}
1719
1313 PKG_PREFIX= /usr/local
1414
1515 PICFLAG?= -fPIC
16
17 SYSCONFDIR?= /etc
18 INITDIR?= ${SYSCONFDIR}/init.d
19 CONFDIR?= ${SYSCONFDIR}/conf.d
1620
1721 BINDIR?= ${PREFIX}/sbin
1822 BINMODE?= 0755
11 root swap sysctl urandom
22 DEFAULT= local netmount
33
4 LEVELDIR= ${DESTDIR}/${PREFIX}/etc/runlevels
4 LEVELDIR= ${DESTDIR}/${PREFIX}/${SYSCONFDIR}/runlevels
55 BOOTDIR= ${LEVELDIR}/boot
66 DEFAULTDIR= ${LEVELDIR}/default
77
1212 include ${MK}/scripts.mk
1313
1414 _installafter:
15 ${INSTALL} -d ${DESTDIR}/${PREFIX}/etc/init.d
15 ${INSTALL} -d ${DESTDIR}/${PREFIX}/${INITDIR}
1616 @# Provide an init script for the loopback interface
17 ln -snf ${PREFIX}/${RC_LIB}/sh/net.sh ${DESTDIR}/${PREFIX}/etc/init.d/${NET_LO} || exit $$?
17 ln -snf ${PREFIX}/${RC_LIB}/sh/net.sh ${DESTDIR}/${PREFIX}/${INITDIR}/${NET_LO} || exit $$?
1818 @# Put functions.sh into the init.d dir so 3rd party apps don't have to
1919 @# be multilib aware
20 ln -snf ${PREFIX}/${RC_LIB}/sh/functions.sh ${DESTDIR}/${PREFIX}/etc/init.d || exit $$?
20 ln -snf ${PREFIX}/${RC_LIB}/sh/functions.sh ${DESTDIR}/${PREFIX}/${INITDIR} || exit $$?
33 # Copyright 2007-2008 Roy Marples <roy@marples.name>
44 # All rights reserved. Released under the 2-clause BSD license.
55
6 . @PREFIX@/etc/init.d/functions.sh
6 . @PREFIX@/@SYSCONFDIR@/init.d/functions.sh
77
88 config() {
99 [ -n "$*" ] && echo "${SVCNAME} config $*" >&3
3232
3333 _done_dirs=
3434 for _dir in \
35 @PREFIX@/etc/init.d \
36 @PKG_PREFIX@/etc/init.d \
37 @LOCAL_PREFIX@/etc/init.d
35 @PREFIX@/@SYSCONFDIR@/init.d \
36 @PKG_PREFIX@/@SYSCONFDIR@/init.d \
37 @LOCAL_PREFIX@/@SYSCONFDIR@/init.d
3838 do
3939 [ -d "${_dir}" ] || continue
4040
7171 . "${_dir}/../conf.d/${SVCNAME}"
7272 fi
7373
74 [ -e @PREFIX@/etc/rc.conf ] && . @PREFIX@/etc/rc.conf
74 [ -e @PREFIX@/@SYSCONFDIR@/rc.conf ] && . @PREFIX@/@SYSCONFDIR@/rc.conf
7575
7676 if . "${_dir}/${SVCNAME}"; then
7777 echo "${SVCNAME}" >&3
33 # Copyright 2007-2008 Roy Marples <roy@marples.name>
44 # All rights reserved. Released under the 2-clause BSD license.
55
6 . @PREFIX@/etc/init.d/functions.sh
6 . @PREFIX@/@SYSCONFDIR@/init.d/functions.sh
77 . "${RC_LIBDIR}"/sh/rc-functions.sh
88
99 # Support LiveCD foo
6060 unset _conf_d
6161
6262 # Load any system overrides
63 [ -e @PREFIX@/etc/rc.conf ] && . @PREFIX@/etc/rc.conf
63 [ -e @PREFIX@/@SYSCONFDIR@/rc.conf ] && . @PREFIX@/@SYSCONFDIR@/rc.conf
6464
6565 # Apply any ulimit defined
6666 [ -n "${rc_ulimit:-${RC_ULIMIT}}" ] && ulimit ${rc_ulimit:-${RC_ULIMIT}}
4040 # define LIB "lib"
4141 #endif
4242
43 #ifndef SYSCONFDIR
44 # define SYSCONFDIR "/etc"
45 #endif
46
4347 #ifdef PREFIX
4448 # define RC_PREFIX PREFIX
4549 #else
5256 #define RC_LIBDIR RC_PREFIX "/" LIB "/rc"
5357 #define RC_SVCDIR RC_LIBDIR "/init.d"
5458 #define RC_DEPTREE RC_SVCDIR "/deptree"
55 #define RC_RUNLEVELDIR RC_PREFIX "/etc/runlevels"
56 #define RC_INITDIR RC_PREFIX "/etc/init.d"
57 #define RC_CONFDIR RC_PREFIX "/etc/conf.d"
59 #define RC_RUNLEVELDIR RC_PREFIX SYSCONFDIR "/runlevels"
60 #define RC_INITDIR RC_PREFIX SYSCONFDIR "/init.d"
61 #define RC_CONFDIR RC_PREFIX SYSCONFDIR "/conf.d"
5862
5963 /* PKG_PREFIX is where packages are installed if different from the base OS
6064 * On Gentoo this is normally unset, on FreeBSD /usr/local and on NetBSD
6165 * /usr/pkg. */
6266 #ifdef PKG_PREFIX
63 # define RC_PKG_INITDIR PKG_PREFIX "/etc/init.d"
64 # define RC_PKG_CONFDIR PKG_PREFIX "/etc/conf.d"
67 # define RC_PKG_INITDIR PKG_PREFIX SYSCONFDIR "/init.d"
68 # define RC_PKG_CONFDIR PKG_PREFIX SYSCONFDIR "/conf.d"
6569 #endif
6670
6771 /* LOCAL_PREFIX is for user written stuff, which the base OS and package
6872 * manger don't touch. */
6973 #ifdef LOCAL_PREFIX
70 # define RC_LOCAL_INITDIR LOCAL_PREFIX "/etc/init.d"
71 # define RC_LOCAL_CONFDIR LOCAL_PREFIX "/etc/conf.d"
74 # define RC_LOCAL_INITDIR LOCAL_PREFIX SYSCONFDIR "/init.d"
75 # define RC_LOCAL_CONFDIR LOCAL_PREFIX SYSCONFDIR "/conf.d"
7276 #endif
7377
7478 #define RC_KSOFTLEVEL RC_SVCDIR "/ksoftlevel"
88 VERSION_MAP= rc.map
99
1010 CFLAGS+= -DLIB=\"${LIBNAME}\"
11 CFLAGS+= -DSYSCONFDIR=\"${SYSCONFDIR}\"
1112 LDADD+= ${LIBKVM}
1213
1314 CFLAGS+= -I../includes
3939
4040 CFLAGS+= -I../includes -I../librc -I../libeinfo
4141 CFLAGS+= -DLIB=\"${LIBNAME}\"
42 CFLAGS+= -DSYSCONFDIR=\"${SYSCONFDIR}\"
4243
4344 include ${MK}/${MKTERMCAP}.mk
4445 LDADD+= ${LIBDL} ${LIBKVM}
4848 #include "rc-misc.h"
4949 #include "strlist.h"
5050
51 #define PROFILE_ENV "/etc/profile.env"
51 #define PROFILE_ENV SYSCONFDIR "/profile.env"
5252 #define SYS_WHITELIST RC_LIBDIR "/conf.d/env_whitelist"
53 #define USR_WHITELIST "/etc/conf.d/env_whitelist"
54 #define RC_CONF "/etc/rc.conf"
55 #define RC_CONF_OLD "/etc/conf.d/rc"
53 #define USR_WHITELIST SYSCONFDIR "/conf.d/env_whitelist"
54 #define RC_CONF SYSCONFDIR "/rc.conf"
55 #define RC_CONF_OLD SYSCONFDIR "/conf.d/rc"
5656
5757 #define PATH_PREFIX RC_LIBDIR "/bin:/bin:/sbin:/usr/bin:/usr/sbin"
5858