# Arkadiusz Miśkiewicz <misiek@pld-linux.org>
# Michał Kochanowicz <mkochano@pld-linux.org>
# Łukasz Pawelczyk <havner@pld-linux.org>
+# Modified for TLD Linux by:
+# Marcin Krol <hawk@tld-linux.org>
# First set up a default search path.
export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
CBUSY="$MAGENTA" # BUSY color
CFAIL="$RED" # FAIL and DIED color
CPOWEREDBY="$CYAN" # "Powered by" color
-CPLD="$GREEN" # "PLD Linux Distribution" color
+CTLD="$GREEN" # "TLD Linux" color
CI="$RED" # Capital I color (press I to enter interactive startup)
CRESMAN="$GREEN" # "Resource Manager" color
CHARS="" # Characters displayed on the beginning of show line
[ -r /etc/sysconfig/system ] && . /etc/sysconfig/system
[ -r /etc/sysconfig/bootsplash ] && . /etc/sysconfig/bootsplash
-# if initscript is invoked via bash, enable RedHat/Fedora compatibility
-# RC_FEDORA is "set" if enabled and "unset" when not, but it's "value" is always empty
-# this is useful for inline constructs
-if [ "${BASH_VERSION+set}" = "set" ]; then
- RC_LOGGING=yes
- FASTRC=no
- RC_FEDORA=
-else
- unset RC_FEDORA || :
-fi
-
if [ -z "$VSERVER" -o "$VSERVER" = "detect" ]; then
{
while read _f _ctx; do
# Apply sysctl settings, including files in /etc/sysctl.d
apply_sysctl() {
- if [ -x /lib/systemd/systemd-sysctl ]; then
- /lib/systemd/systemd-sysctl
- return
- fi
-
local file
- for file in /usr/lib/sysctl.d/*.conf; do
- [ -f /run/sysctl.d/${file##*/} ] && continue
- [ -f /etc/sysctl.d/${file##*/} ] && continue
- test -f "$file" && sysctl -q -e -p "$file"
- done
- for file in /run/sysctl.d/*.conf; do
- [ -f /etc/sysctl.d/${file##*/} ] && continue
- test -f "$file" && sysctl -q -e -p "$file"
- done
for file in /etc/sysctl.d/*.conf; do
test -f "$file" && sysctl -q -e -p "$file"
done
nls "Usage: %s" "$*"
}
-# Some functions to handle PLD Linux-style messages
+# Some functions to handle TLD Linux-style messages
show() {
local text len time
}
ok() {
- echo -ne "$_ok${RC_FEDORA+\\r}${RC_FEDORA-\\n}"
+ echo "$_ok"
}
started() {
}
fail() {
- echo -ne "$_fail${RC_FEDORA+\\r}${RC_FEDORA-\\n}"
+ echo "$_fail"
return 1
}
cd /
export HOME=/tmp TMPDIR=/tmp
if is_no "$RC_LOGGING"; then
- ${user:+setuidgid -s $user} "$@" 2>&1
+ ${user:+setuidgid -s $user} eval "$@" 2>&1
else
${user:+setuidgid -s $user} initlog -c "$*" 2>&1
fi
# A function to start a program (now it's useful on read-only filesystem too)
daemon() {
- local errors="" prog="" end="" waitname="" waittime=""
+ local errors="" prog="" end="" waitname="" waittime=0
local exit_code=0
local nice=$SERVICE_RUN_NICE_LEVEL
local fork user closefds redirfds pidfile makepid chdir=/
for p in $(< "${pidfile}"); do
[ -z "$(echo "$p" | awk '{gsub(/[0-9]/,"");print;}')" ] && pid="$pid $p"
done
+ else
+ unset pidfile
fi
# Next try "pidof" if pidfile is not specified
fi
}
-use_upstart () {
- return 1
-}
-emit () {
- return 0
-}
-is_upstart_task() {
- return 1
-}
-is_upstart_running() {
- return 1
-}
-upstart_start() {
- return 1
-}
-upstart_stop() {
- return 1
-}
-upstart_reload() {
- return 0
-}
-upstart_status() {
- return 1
-}
-_upstart_controlled() {
- return 0
-}
-alias upstart_controlled='_upstart_controlled $0 "$@"'
-
rc_gettext_init
rc_cache_init