Initial commit
This commit is contained in:
Executable
+209
@@ -0,0 +1,209 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# alsa-utils initscript
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: alsa-utils
|
||||
# Required-Start: $local_fs $remote_fs
|
||||
# Required-Stop: $remote_fs
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Restore and store ALSA driver settings
|
||||
# Description: This script stores and restores mixer levels on
|
||||
# shutdown and bootup.On sysv-rc systems: to
|
||||
# disable storing of mixer levels on shutdown,
|
||||
# remove /etc/rc[06].d/K50alsa-utils. To disable
|
||||
# restoring of mixer levels on bootup, rename the
|
||||
# "S50alsa-utils" symbolic link in /etc/rcS.d/ to
|
||||
# "K50alsa-utils".
|
||||
### END INIT INFO
|
||||
|
||||
# Don't use set -e; check exit status instead
|
||||
|
||||
# Exit silently if package is no longer installed
|
||||
[ -x /usr/sbin/alsactl ] || exit 0
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
MYNAME=/etc/init.d/alsa-utils
|
||||
ALSACTLHOME=/run/alsa
|
||||
|
||||
[ -d "$ALSACTLHOME" ] || mkdir -p "$ALSACTLHOME"
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
. /usr/share/alsa/utils.sh
|
||||
|
||||
# $1 EXITSTATUS
|
||||
# [$2 MESSAGE]
|
||||
log_action_end_msg_and_exit()
|
||||
{
|
||||
log_action_end_msg "$1" ${2:+"$2"}
|
||||
exit $1
|
||||
}
|
||||
|
||||
# $1 PROGRAM
|
||||
executable()
|
||||
{
|
||||
# If which is not available then we must be running before
|
||||
# /usr is mounted on a system that has which in /usr/bin/.
|
||||
# Conclude that $1 is not executable.
|
||||
[ -x /bin/which ] || [ -x /usr/bin/which ] || return 1
|
||||
which "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
executable amixer || { echo "${MYNAME}: Error: No amixer program available." >&2 ; exit 1 ; }
|
||||
|
||||
# $1 <card ID> | "all"
|
||||
restore_levels()
|
||||
{
|
||||
[ -f /var/lib/alsa/asound.state ] || return 1
|
||||
CARD="$1"
|
||||
[ "$1" = all ] && CARD=""
|
||||
# Assume that if alsactl prints a message on stderr
|
||||
# then it failed somehow. This works around the fact
|
||||
# that alsactl doesn't return nonzero status when it
|
||||
# can't restore settings for the card
|
||||
if MSG="$(alsactl -E HOME="$ALSACTLHOME" -E XDG_RUNTIME_DIR="${ALSACTLRUNTIME}" restore $CARD 2>&1 >/dev/null)" && [ ! "$MSG" ] ; then
|
||||
return 0
|
||||
else
|
||||
# Retry with the "force" option. This restores more levels
|
||||
# but it results in much longer error messages.
|
||||
alsactl -E HOME="$ALSACTLHOME" -E XDG_RUNTIME_DIR="${ALSACTLRUNTIME}" -F restore $CARD >/dev/null 2>&1
|
||||
log_action_cont_msg "warning: 'alsactl -E HOME="$ALSACTLHOME" -E XDG_RUNTIME_DIR="${ALSACTLRUNTIME}" restore${CARD:+ $CARD}' failed with error message '$MSG'"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# $1 <card ID> | "all"
|
||||
store_levels()
|
||||
{
|
||||
CARD="$1"
|
||||
[ "$1" = all ] && CARD=""
|
||||
if MSG="$(alsactl -E HOME="$ALSACTLHOME" -E XDG_RUNTIME_DIR="${ALSACTLRUNTIME}" store $CARD 2>&1)" ; then
|
||||
sleep 1
|
||||
return 0
|
||||
else
|
||||
log_action_cont_msg "warning: 'alsactl store${CARD:+ $CARD}' -E HOME="$ALSACTLHOME" -E XDG_RUNTIME_DIR=@alsactlruntime@ failed with error message '$MSG'"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# $1 <card ID>
|
||||
mute_and_zero_levels_on_card()
|
||||
{
|
||||
CARDOPT="-c $1"
|
||||
for CTL in \
|
||||
Master \
|
||||
PCM \
|
||||
Synth \
|
||||
CD \
|
||||
Line \
|
||||
Mic \
|
||||
"PCM,1" \
|
||||
Wave \
|
||||
Music \
|
||||
AC97 \
|
||||
"Master Digital" \
|
||||
DAC \
|
||||
"DAC,0" \
|
||||
"DAC,1" \
|
||||
Headphone \
|
||||
Speaker \
|
||||
Playback
|
||||
do
|
||||
mute_and_zero_level "$CTL"
|
||||
done
|
||||
# for CTL in \
|
||||
# "Audigy Analog/Digital Output Jack" \
|
||||
# "SB Live Analog/Digital Output Jack"
|
||||
# do
|
||||
# switch_control "$CTL" off
|
||||
# done
|
||||
return 0
|
||||
}
|
||||
|
||||
# $1 <card ID> | "all"
|
||||
mute_and_zero_levels()
|
||||
{
|
||||
TTZML_RETURNSTATUS=0
|
||||
case "$1" in
|
||||
all)
|
||||
for CARD in $(echo_card_indices) ; do
|
||||
mute_and_zero_levels_on_card "$CARD" || TTZML_RETURNSTATUS=1
|
||||
done
|
||||
;;
|
||||
*)
|
||||
mute_and_zero_levels_on_card "$1" || TTZML_RETURNSTATUS=1
|
||||
;;
|
||||
esac
|
||||
return $TTZML_RETURNSTATUS
|
||||
}
|
||||
|
||||
|
||||
# $1 <card ID> | "all"
|
||||
card_OK()
|
||||
{
|
||||
[ "$1" ] || bugout
|
||||
if [ "$1" = all ] ; then
|
||||
[ -d /proc/asound ]
|
||||
return $?
|
||||
else
|
||||
[ -d "/proc/asound/card$1" ] || [ -d "/proc/asound/$1" ]
|
||||
return $?
|
||||
fi
|
||||
}
|
||||
|
||||
# If a card identifier is provided in $2 then regard it as an error
|
||||
# if that card is not present; otherwise don't regard it as an error.
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
EXITSTATUS=0
|
||||
TARGET_CARD="$2"
|
||||
case "$TARGET_CARD" in
|
||||
""|all) TARGET_CARD=all ; log_action_begin_msg "Setting up ALSA" ;;
|
||||
*) log_action_begin_msg "Setting up ALSA card ${TARGET_CARD}" ;;
|
||||
esac
|
||||
card_OK "$TARGET_CARD" || log_action_end_msg_and_exit "$( [ ! "$2" ] ; echo $? ; )" "none loaded"
|
||||
preinit_levels "$TARGET_CARD" || EXITSTATUS=1
|
||||
if ! restore_levels "$TARGET_CARD" ; then
|
||||
sanify_levels "$TARGET_CARD" || EXITSTATUS=1
|
||||
restore_levels "$TARGET_CARD" >/dev/null 2>&1 || :
|
||||
fi
|
||||
log_action_end_msg_and_exit "$EXITSTATUS"
|
||||
;;
|
||||
stop)
|
||||
EXITSTATUS=0
|
||||
TARGET_CARD="$2"
|
||||
case "$TARGET_CARD" in
|
||||
""|all) TARGET_CARD=all ; log_action_begin_msg "Shutting down ALSA" ;;
|
||||
*) log_action_begin_msg "Shutting down ALSA card ${TARGET_CARD}" ;;
|
||||
esac
|
||||
card_OK "$TARGET_CARD" || log_action_end_msg_and_exit "$( [ ! "$2" ] ; echo $? ; )" "none loaded"
|
||||
store_levels "$TARGET_CARD" || EXITSTATUS=1
|
||||
#mute_and_zero_levels "$TARGET_CARD" || EXITSTATUS=1
|
||||
log_action_end_msg_and_exit "$EXITSTATUS"
|
||||
;;
|
||||
restart|force-reload)
|
||||
EXITSTATUS=0
|
||||
$0 stop || EXITSTATUS=1
|
||||
$0 start || EXITSTATUS=1
|
||||
exit $EXITSTATUS
|
||||
;;
|
||||
reset)
|
||||
TARGET_CARD="$2"
|
||||
case "$TARGET_CARD" in
|
||||
""|all) TARGET_CARD=all ; log_action_begin_msg "Resetting ALSA" ;;
|
||||
*) log_action_begin_msg "Resetting ALSA card ${TARGET_CARD}" ;;
|
||||
esac
|
||||
card_OK "$TARGET_CARD" || log_action_end_msg_and_exit "$( [ ! "$2" ] ; echo $? ; )" "none loaded"
|
||||
preinit_levels "$TARGET_CARD"
|
||||
sanify_levels "$TARGET_CARD"
|
||||
log_action_end_msg_and_exit "$?"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $MYNAME {start [CARD]|stop [CARD]|restart [CARD]|reset [CARD]}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
Executable
+69
@@ -0,0 +1,69 @@
|
||||
#! /bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: anacron
|
||||
# Required-Start: $remote_fs $syslog $time
|
||||
# Required-Stop: $remote_fs $syslog $time
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop:
|
||||
# Short-Description: Run anacron jobs
|
||||
# Description: The first purpose of this script is to run anacron at
|
||||
# boot so that it can catch up with missed jobs. Note
|
||||
# that anacron is not a daemon. It is run here just once
|
||||
# and is later started by the real cron. The second
|
||||
# purpose of this script is that said cron job invokes
|
||||
# this script to start anacron at those subsequent times,
|
||||
# to keep the logic in one place.
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||
|
||||
test -x /usr/sbin/anacron || exit 0
|
||||
test -r /etc/default/anacron && . /etc/default/anacron
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if init_is_upstart 2>/dev/null; then
|
||||
exit 1
|
||||
fi
|
||||
log_daemon_msg "Starting anac(h)ronistic cron" "anacron"
|
||||
if test x"$ANACRON_RUN_ON_BATTERY_POWER" != x"yes" && test -x /usr/bin/on_ac_power
|
||||
then
|
||||
/usr/bin/on_ac_power >/dev/null
|
||||
if test $? -eq 1
|
||||
then
|
||||
log_progress_msg "deferred while on battery power"
|
||||
log_end_msg 0
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# on_ac_power doesn't exist, on_ac_power returns 0 (ac power being used)
|
||||
# or on_ac_power returns 255 (undefined, desktop machine without APM)
|
||||
start-stop-daemon --start --exec /usr/sbin/anacron -- $ANACRON_ARGS
|
||||
log_end_msg 0
|
||||
;;
|
||||
restart|force-reload|reload)
|
||||
# nothing to do
|
||||
:
|
||||
;;
|
||||
stop)
|
||||
if init_is_upstart 2>/dev/null && status anacron 2>/dev/null | grep -q start
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
log_daemon_msg "Stopping anac(h)ronistic cron" "anacron"
|
||||
start-stop-daemon --stop --exec /usr/sbin/anacron --oknodo --quiet --retry=USR1/90/TERM/5/KILL/5
|
||||
log_end_msg 0
|
||||
;;
|
||||
status)
|
||||
exit 4
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/anacron {start|stop|restart|force-reload|reload}"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+71
@@ -0,0 +1,71 @@
|
||||
#!/bin/sh
|
||||
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
|
||||
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
|
||||
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
|
||||
fi
|
||||
### BEGIN INIT INFO
|
||||
# Provides: apache-htcacheclean
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Cache cleaner process for Apache2 web server
|
||||
# Description: Start the htcacheclean helper
|
||||
# This script will start htcacheclean which will periodically scan the
|
||||
# cache directory of Apache2's mod_cache_disk and remove outdated files.
|
||||
### END INIT INFO
|
||||
|
||||
DESC="Apache htcacheclean"
|
||||
DAEMON=/usr/bin/htcacheclean
|
||||
|
||||
NAME="${0##*/}"
|
||||
NAME="${NAME##[KS][0-9][0-9]}"
|
||||
DIR_SUFFIX="${NAME##apache-htcacheclean}"
|
||||
APACHE_CONFDIR="${APACHE_CONFDIR:=/etc/apache2$DIR_SUFFIX}"
|
||||
RUN_USER=$(. $APACHE_CONFDIR/envvars > /dev/null && echo "$APACHE_RUN_USER")
|
||||
|
||||
# Default values. Edit /etc/default/apache-htcacheclean$DIR_SUFFIX to change these
|
||||
HTCACHECLEAN_SIZE="${HTCACHECLEAN_SIZE:=300M}"
|
||||
HTCACHECLEAN_DAEMON_INTERVAL="${HTCACHECLEAN_DAEMON_INTERVAL:=120}"
|
||||
HTCACHECLEAN_PATH="${HTCACHECLEAN_PATH:=/var/cache/apache2$DIR_SUFFIX/mod_cache_disk}"
|
||||
HTCACHECLEAN_OPTIONS="${HTCACHECLEAN_OPTIONS:=-n}"
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
if [ -f /etc/default/apache-htcacheclean$DIR_SUFFIX ] ; then
|
||||
. /etc/default/apache-htcacheclean$DIR_SUFFIX
|
||||
elif [ -f /etc/default/apache-htcacheclean ] ; then
|
||||
. /etc/default/apache-htcacheclean
|
||||
fi
|
||||
|
||||
PIDDIR="/var/run/apache2/$RUN_USER"
|
||||
PIDFILE="$PIDDIR/$NAME.pid"
|
||||
DAEMON_ARGS="$HTCACHECLEAN_OPTIONS \
|
||||
-d$HTCACHECLEAN_DAEMON_INTERVAL \
|
||||
-P$PIDFILE -i \
|
||||
-p$HTCACHECLEAN_PATH \
|
||||
-l$HTCACHECLEAN_SIZE"
|
||||
|
||||
do_start_prepare () {
|
||||
if [ ! -d "$PIDDIR" ] ; then
|
||||
mkdir -p "$PIDDIR"
|
||||
chown "$RUN_USER:" "$PIDDIR"
|
||||
fi
|
||||
if [ ! -d "$HTCACHECLEAN_PATH" ] ; then
|
||||
echo "Directory $HTCACHECLEAN_PATH does not exist!" >&2
|
||||
exit 2
|
||||
fi
|
||||
}
|
||||
|
||||
do_start_cmd_override () {
|
||||
start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
|
||||
-u $RUN_USER --startas $DAEMON --name htcacheclean --test > /dev/null \
|
||||
|| return 1
|
||||
start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
|
||||
-c $RUN_USER --startas $DAEMON --name htcacheclean -- $DAEMON_ARGS \
|
||||
|| return 2
|
||||
}
|
||||
|
||||
do_stop_cmd_override () {
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
|
||||
-u $RUN_USER --pidfile ${PIDFILE} --name htcacheclean
|
||||
}
|
||||
Executable
+355
@@ -0,0 +1,355 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: apache2
|
||||
# Required-Start: $local_fs $remote_fs $network $syslog $named
|
||||
# Required-Stop: $local_fs $remote_fs $network $syslog $named
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# X-Interactive: true
|
||||
# Short-Description: Apache2 web server
|
||||
# Description: Start the web server
|
||||
# This script will start the apache2 web server.
|
||||
### END INIT INFO
|
||||
|
||||
DESC="Apache httpd web server"
|
||||
NAME=apache2
|
||||
DAEMON=/usr/sbin/$NAME
|
||||
|
||||
SCRIPTNAME="${0##*/}"
|
||||
SCRIPTNAME="${SCRIPTNAME##[KS][0-9][0-9]}"
|
||||
if [ -n "$APACHE_CONFDIR" ] ; then
|
||||
if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
|
||||
DIR_SUFFIX="${APACHE_CONFDIR##/etc/apache2-}"
|
||||
else
|
||||
DIR_SUFFIX=
|
||||
fi
|
||||
elif [ "${SCRIPTNAME##apache2-}" != "$SCRIPTNAME" ] ; then
|
||||
DIR_SUFFIX="-${SCRIPTNAME##apache2-}"
|
||||
APACHE_CONFDIR=/etc/apache2$DIR_SUFFIX
|
||||
else
|
||||
DIR_SUFFIX=
|
||||
APACHE_CONFDIR=/etc/apache2
|
||||
fi
|
||||
if [ -z "$APACHE_ENVVARS" ] ; then
|
||||
APACHE_ENVVARS=$APACHE_CONFDIR/envvars
|
||||
fi
|
||||
export APACHE_CONFDIR APACHE_ENVVARS
|
||||
|
||||
ENV="env -i LANG=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
if [ "$APACHE_CONFDIR" != /etc/apache2 ] ; then
|
||||
ENV="$ENV APACHE_CONFDIR=$APACHE_CONFDIR"
|
||||
fi
|
||||
if [ "$APACHE_ENVVARS" != "$APACHE_CONFDIR/envvars" ] ; then
|
||||
ENV="$ENV APACHE_ENVVARS=$APACHE_ENVVARS"
|
||||
fi
|
||||
|
||||
PIDFILE=$(. $APACHE_ENVVARS && echo $APACHE_PID_FILE)
|
||||
|
||||
VERBOSE=no
|
||||
if [ -f /etc/default/rcS ]; then
|
||||
. /etc/default/rcS
|
||||
fi
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
|
||||
# Now, set defaults:
|
||||
APACHE2CTL="$ENV apache2ctl"
|
||||
PIDFILE=$(. $APACHE_ENVVARS && echo $APACHE_PID_FILE)
|
||||
APACHE2_INIT_MESSAGE=""
|
||||
|
||||
CONFTEST_OUTFILE=
|
||||
cleanup() {
|
||||
if [ -n "$CONFTEST_OUTFILE" ] ; then
|
||||
rm -f "$CONFTEST_OUTFILE"
|
||||
fi
|
||||
}
|
||||
trap cleanup 0 # "0" means "EXIT", but "EXIT" is not portable
|
||||
|
||||
|
||||
apache_conftest() {
|
||||
[ -z "$CONFTEST_OUTFILE" ] || rm -f "$CONFTEST_OUTFILE"
|
||||
CONFTEST_OUTFILE=$(mktemp)
|
||||
if ! $APACHE2CTL configtest > "$CONFTEST_OUTFILE" 2>&1 ; then
|
||||
return 1
|
||||
else
|
||||
rm -f "$CONFTEST_OUTFILE"
|
||||
CONFTEST_OUTFILE=
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
clear_error_msg() {
|
||||
[ -z "$CONFTEST_OUTFILE" ] || rm -f "$CONFTEST_OUTFILE"
|
||||
CONFTEST_OUTFILE=
|
||||
APACHE2_INIT_MESSAGE=
|
||||
}
|
||||
|
||||
print_error_msg() {
|
||||
[ -z "$APACHE2_INIT_MESSAGE" ] || log_warning_msg "$APACHE2_INIT_MESSAGE"
|
||||
if [ -n "$CONFTEST_OUTFILE" ] ; then
|
||||
echo "Output of config test was:" >&2
|
||||
cat "$CONFTEST_OUTFILE" >&2
|
||||
rm -f "$CONFTEST_OUTFILE"
|
||||
CONFTEST_OUTFILE=
|
||||
fi
|
||||
}
|
||||
|
||||
apache_wait_start() {
|
||||
local STATUS=$1
|
||||
local i=0
|
||||
|
||||
if [ $STATUS != 0 ] ; then
|
||||
return $STATUS
|
||||
fi
|
||||
while : ; do
|
||||
PIDTMP=$(pidofproc -p $PIDFILE $DAEMON)
|
||||
if [ -n "${PIDTMP:-}" ] && kill -0 "${PIDTMP:-}" 2> /dev/null; then
|
||||
return $STATUS
|
||||
fi
|
||||
|
||||
if [ $i = "20" ] ; then
|
||||
APACHE2_INIT_MESSAGE="The apache2$DIR_SUFFIX instance did not start within 20 seconds. Please read the log files to discover problems"
|
||||
return 2
|
||||
fi
|
||||
|
||||
[ "$VERBOSE" != no ] && log_progress_msg "."
|
||||
sleep 1
|
||||
i=$(($i+1))
|
||||
done
|
||||
}
|
||||
|
||||
apache_wait_stop() {
|
||||
local STATUS=$1
|
||||
local METH=$2
|
||||
|
||||
if [ $STATUS != 0 ] ; then
|
||||
return $STATUS
|
||||
fi
|
||||
|
||||
PIDTMP=$(pidofproc -p $PIDFILE $DAEMON)
|
||||
if [ -n "${PIDTMP:-}" ] && kill -0 "${PIDTMP:-}" 2> /dev/null; then
|
||||
if [ "$METH" = "kill" ]; then
|
||||
killproc -p $PIDFILE $DAEMON
|
||||
else
|
||||
$APACHE2CTL $METH > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
local i=0
|
||||
while kill -0 "${PIDTMP:-}" 2> /dev/null; do
|
||||
if [ $i = '60' ]; then
|
||||
STATUS=2
|
||||
break
|
||||
fi
|
||||
[ "$VERBOSE" != no ] && log_progress_msg "."
|
||||
sleep 1
|
||||
i=$(($i+1))
|
||||
done
|
||||
return $STATUS
|
||||
else
|
||||
return $STATUS
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service
|
||||
#
|
||||
do_start()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
|
||||
if pidofproc -p $PIDFILE "$DAEMON" > /dev/null 2>&1 ; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if apache_conftest ; then
|
||||
$APACHE2CTL start
|
||||
apache_wait_start $?
|
||||
return $?
|
||||
else
|
||||
APACHE2_INIT_MESSAGE="The apache2$DIR_SUFFIX configtest failed."
|
||||
return 2
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service
|
||||
#
|
||||
do_stop()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been stopped
|
||||
# 1 if daemon was already stopped
|
||||
# 2 if daemon could not be stopped
|
||||
# other if a failure occurred
|
||||
|
||||
# either "stop" or "graceful-stop"
|
||||
local STOP=$1
|
||||
# can't use pidofproc from LSB here
|
||||
local AP_RET=0
|
||||
|
||||
if pidof $DAEMON > /dev/null 2>&1 ; then
|
||||
if [ -e $PIDFILE ] && pidof $DAEMON | tr ' ' '\n' | grep -w $(cat $PIDFILE) > /dev/null 2>&1 ; then
|
||||
AP_RET=2
|
||||
else
|
||||
AP_RET=1
|
||||
fi
|
||||
else
|
||||
AP_RET=0
|
||||
fi
|
||||
|
||||
# AP_RET is:
|
||||
# 0 if Apache (whichever) is not running
|
||||
# 1 if Apache (whichever) is running
|
||||
# 2 if Apache from the PIDFILE is running
|
||||
|
||||
if [ $AP_RET = 0 ] ; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ $AP_RET = 2 ] && apache_conftest ; then
|
||||
apache_wait_stop $? $STOP
|
||||
return $?
|
||||
else
|
||||
if [ $AP_RET = 2 ]; then
|
||||
clear_error_msg
|
||||
APACHE2_INIT_MESSAGE="The apache2$DIR_SUFFIX configtest failed, so we are trying to kill it manually. This is almost certainly suboptimal, so please make sure your system is working as you'd expect now!"
|
||||
apache_wait_stop $? "kill"
|
||||
return $?
|
||||
elif [ $AP_RET = 1 ] ; then
|
||||
APACHE2_INIT_MESSAGE="There are processes named 'apache2' running which do not match your pid file which are left untouched in the name of safety, Please review the situation by hand".
|
||||
return 2
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Function that sends a SIGHUP to the daemon/service
|
||||
#
|
||||
do_reload() {
|
||||
if apache_conftest; then
|
||||
if ! pidofproc -p $PIDFILE "$DAEMON" > /dev/null 2>&1 ; then
|
||||
APACHE2_INIT_MESSAGE="Apache2 is not running"
|
||||
return 2
|
||||
fi
|
||||
$APACHE2CTL graceful > /dev/null 2>&1
|
||||
return $?
|
||||
else
|
||||
APACHE2_INIT_MESSAGE="The apache2$DIR_SUFFIX configtest failed. Not doing anything."
|
||||
return 2
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Sanity checks. They need to occur after function declarations
|
||||
[ -x $DAEMON ] || exit 0
|
||||
|
||||
if [ ! -x $DAEMON ] ; then
|
||||
echo "No apache-bin package installed"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "$PIDFILE" ] ; then
|
||||
echo ERROR: APACHE_PID_FILE needs to be defined in $APACHE_ENVVARS >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting $DESC" "$NAME"
|
||||
do_start
|
||||
RET_STATUS=$?
|
||||
case "$RET_STATUS" in
|
||||
0|1)
|
||||
log_success_msg
|
||||
[ "$VERBOSE" != no ] && [ $RET_STATUS = 1 ] && log_warning_msg "Server was already running"
|
||||
;;
|
||||
2)
|
||||
log_failure_msg
|
||||
print_error_msg
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
stop|graceful-stop)
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop "$1"
|
||||
RET_STATUS=$?
|
||||
case "$RET_STATUS" in
|
||||
0|1)
|
||||
log_success_msg
|
||||
[ "$VERBOSE" != no ] && [ $RET_STATUS = 1 ] && log_warning_msg "Server was not running"
|
||||
;;
|
||||
2)
|
||||
log_failure_msg
|
||||
print_error_msg
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
print_error_msg
|
||||
|
||||
;;
|
||||
status)
|
||||
status_of_proc -p $PIDFILE "apache2" "$NAME"
|
||||
exit $?
|
||||
;;
|
||||
reload|force-reload|graceful)
|
||||
log_daemon_msg "Reloading $DESC" "$NAME"
|
||||
do_reload
|
||||
RET_STATUS=$?
|
||||
case "$RET_STATUS" in
|
||||
0|1)
|
||||
log_success_msg
|
||||
[ "$VERBOSE" != no ] && [ $RET_STATUS = 1 ] && log_warning_msg "Server was already running"
|
||||
;;
|
||||
2)
|
||||
log_failure_msg
|
||||
print_error_msg
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
print_error_msg
|
||||
;;
|
||||
restart)
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
do_stop stop
|
||||
case "$?" in
|
||||
0|1)
|
||||
do_start
|
||||
case "$?" in
|
||||
0)
|
||||
log_end_msg 0
|
||||
;;
|
||||
1|*)
|
||||
log_end_msg 1 # Old process is still or failed to running
|
||||
print_error_msg
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
print_error_msg
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
start-htcacheclean|stop-htcacheclean)
|
||||
echo "Use 'service apache-htcacheclean' instead"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|graceful-stop|restart|reload|force-reload}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# vim: syntax=sh ts=4 sw=4 sts=4 sr noet
|
||||
Executable
+156
@@ -0,0 +1,156 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------
|
||||
# Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
||||
# NOVELL (All rights reserved)
|
||||
# Copyright (c) 2008, 2009 Canonical, Ltd.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of version 2 of the GNU General Public
|
||||
# License published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, contact Novell, Inc.
|
||||
# ----------------------------------------------------------------------
|
||||
# Authors:
|
||||
# Steve Beattie <steve.beattie@canonical.com>
|
||||
# Kees Cook <kees@ubuntu.com>
|
||||
#
|
||||
# /etc/init.d/apparmor
|
||||
#
|
||||
# Note: "Required-Start: $local_fs" implies that the cache may not be available
|
||||
# yet when /var is on a remote filesystem. The worst consequence this should
|
||||
# have is slowing down the boot.
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: apparmor
|
||||
# Required-Start: $local_fs
|
||||
# Required-Stop: umountfs
|
||||
# Default-Start: S
|
||||
# Default-Stop:
|
||||
# Short-Description: AppArmor initialization
|
||||
# Description: AppArmor init script. This script loads all AppArmor profiles.
|
||||
### END INIT INFO
|
||||
|
||||
APPARMOR_FUNCTIONS=/lib/apparmor/rc.apparmor.functions
|
||||
|
||||
# Functions needed by rc.apparmor.functions
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
aa_action() {
|
||||
STRING=$1
|
||||
shift
|
||||
$*
|
||||
rc=$?
|
||||
if [ $rc -eq 0 ] ; then
|
||||
aa_log_success_msg $"$STRING "
|
||||
else
|
||||
aa_log_failure_msg $"$STRING "
|
||||
fi
|
||||
return $rc
|
||||
}
|
||||
|
||||
aa_log_action_start() {
|
||||
log_action_begin_msg $@
|
||||
}
|
||||
|
||||
aa_log_action_end() {
|
||||
log_action_end_msg $@
|
||||
}
|
||||
|
||||
aa_log_success_msg() {
|
||||
log_success_msg $@
|
||||
}
|
||||
|
||||
aa_log_warning_msg() {
|
||||
log_warning_msg $@
|
||||
}
|
||||
|
||||
aa_log_failure_msg() {
|
||||
log_failure_msg $@
|
||||
}
|
||||
|
||||
aa_log_skipped_msg() {
|
||||
if [ -n "$1" ]; then
|
||||
log_warning_msg "${1}: Skipped."
|
||||
fi
|
||||
}
|
||||
|
||||
aa_log_daemon_msg() {
|
||||
log_daemon_msg $@
|
||||
}
|
||||
|
||||
aa_log_end_msg() {
|
||||
log_end_msg $@
|
||||
}
|
||||
|
||||
# Source AppArmor function library
|
||||
if [ -f "${APPARMOR_FUNCTIONS}" ]; then
|
||||
. ${APPARMOR_FUNCTIONS}
|
||||
else
|
||||
aa_log_failure_msg "Unable to find AppArmor initscript functions"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 {start|stop|restart|reload|force-reload|status}"
|
||||
}
|
||||
|
||||
test -x ${PARSER} || exit 0 # by debian policy
|
||||
# LSM is built-in, so it is either there or not enabled for this boot
|
||||
test -d /sys/module/apparmor || exit 0
|
||||
|
||||
# do not perform start/stop/reload actions when running from liveCD
|
||||
test -d /rofs/etc/apparmor.d && exit 0
|
||||
|
||||
rc=255
|
||||
case "$1" in
|
||||
start)
|
||||
if [ -x /usr/bin/systemd-detect-virt ] && \
|
||||
systemd-detect-virt --quiet --container && \
|
||||
! is_container_with_internal_policy; then
|
||||
aa_log_daemon_msg "Not starting AppArmor in container"
|
||||
aa_log_end_msg 0
|
||||
exit 0
|
||||
fi
|
||||
apparmor_start
|
||||
rc=$?
|
||||
;;
|
||||
restart|reload|force-reload)
|
||||
if [ -x /usr/bin/systemd-detect-virt ] && \
|
||||
systemd-detect-virt --quiet --container && \
|
||||
! is_container_with_internal_policy; then
|
||||
aa_log_daemon_msg "Not starting AppArmor in container"
|
||||
aa_log_end_msg 0
|
||||
exit 0
|
||||
fi
|
||||
apparmor_restart
|
||||
rc=$?
|
||||
;;
|
||||
stop)
|
||||
aa_log_daemon_msg "Leaving AppArmor profiles loaded"
|
||||
cat >&2 <<EOM
|
||||
No profiles have been unloaded.
|
||||
|
||||
Unloading profiles will leave already running processes permanently
|
||||
unconfined, which can lead to unexpected situations.
|
||||
|
||||
To set a process to complain mode, use the command line tool
|
||||
'aa-complain'. To really tear down all profiles, run 'aa-teardown'."
|
||||
EOM
|
||||
;;
|
||||
status)
|
||||
apparmor_status
|
||||
rc=$?
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
rc=1
|
||||
;;
|
||||
esac
|
||||
exit $rc
|
||||
Executable
+104
@@ -0,0 +1,104 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: avahi avahi-daemon
|
||||
# Required-Start: $remote_fs dbus
|
||||
# Required-Stop: $remote_fs dbus
|
||||
# Should-Start: $syslog
|
||||
# Should-Stop: $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Avahi mDNS/DNS-SD Daemon
|
||||
# Description: Zeroconf daemon for configuring your network
|
||||
# automatically
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DESC="Avahi mDNS/DNS-SD Daemon"
|
||||
NAME="avahi-daemon"
|
||||
DAEMON="/usr/sbin/$NAME"
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
|
||||
# Gracefully exit if the package has been removed.
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
# Include avahi-daemon defaults if available.
|
||||
test -f /etc/default/avahi-daemon && . /etc/default/avahi-daemon
|
||||
|
||||
DISABLE_TAG="/var/run/avahi-daemon/disabled-for-unicast-local"
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service.
|
||||
#
|
||||
d_start() {
|
||||
$DAEMON -c && return 0
|
||||
|
||||
if [ -e $DISABLE_TAG -a "$AVAHI_DAEMON_DETECT_LOCAL" != "0" ]; then
|
||||
# Disabled because of the existance of an unicast .local domain
|
||||
log_warning_msg "avahi-daemon disabled because there is a unicast .local domain"
|
||||
exit 0;
|
||||
fi;
|
||||
|
||||
$DAEMON -D
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service.
|
||||
#
|
||||
d_stop() {
|
||||
if $DAEMON -c ; then
|
||||
$DAEMON -k
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Function that reload the config file for the daemon/service.
|
||||
#
|
||||
d_reload() {
|
||||
$DAEMON -c && $DAEMON -r
|
||||
}
|
||||
|
||||
#
|
||||
# Function that check the status of the daemon/service.
|
||||
#
|
||||
d_status() {
|
||||
$DAEMON -c && { echo "$DESC is running"; exit 0; } || { echo "$DESC is not running"; exit 3; }
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting $DESC" "$NAME"
|
||||
d_start
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
d_stop
|
||||
log_end_msg $?
|
||||
;;
|
||||
reload|force-reload)
|
||||
log_daemon_msg "Reloading services for $DESC" "$NAME"
|
||||
d_reload
|
||||
log_end_msg $?
|
||||
;;
|
||||
restart)
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
d_stop
|
||||
if [ "$?" -eq 0 ]; then
|
||||
d_start
|
||||
log_end_msg $?
|
||||
else
|
||||
log_end_msg 1
|
||||
fi
|
||||
;;
|
||||
status)
|
||||
d_status
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|reload|status}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+134
@@ -0,0 +1,134 @@
|
||||
#! /bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: bluetooth
|
||||
# Required-Start: $local_fs $syslog $remote_fs dbus
|
||||
# Required-Stop: $local_fs $syslog $remote_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Start bluetooth daemons
|
||||
### END INIT INFO
|
||||
#
|
||||
# bluez Bluetooth subsystem starting and stopping
|
||||
#
|
||||
# originally from bluez's scripts/bluetooth.init
|
||||
#
|
||||
# Edd Dumbill <ejad@debian.org>
|
||||
# LSB 3.0 compilance and enhancements by Filippo Giunchedi <filippo@debian.org>
|
||||
#
|
||||
# Updated for bluez 4.7 by Mario Limonciello <mario_limonciello@dell.com>
|
||||
# Updated for bluez 5.5 by Nobuhiro Iwamatsu <iwamatsu@debian.org>
|
||||
#
|
||||
# Note: older daemons like dund pand hidd are now shipped inside the
|
||||
# bluez-compat package
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DESC=bluetooth
|
||||
|
||||
DAEMON=/usr/sbin/bluetoothd
|
||||
HCIATTACH=/usr/bin/hciattach
|
||||
|
||||
HID2HCI_ENABLED=1
|
||||
HID2HCI_UNDO=1
|
||||
|
||||
SDPTOOL=/usr/bin/sdptool
|
||||
|
||||
# If you want to be ignore error of "org.freedesktop.hostname1",
|
||||
# please enable NOPLUGIN_OPTION.
|
||||
# NOPLUGIN_OPTION="--noplugin=hostname"
|
||||
NOPLUGIN_OPTION=""
|
||||
SSD_OPTIONS="--oknodo --quiet --exec $DAEMON -- $NOPLUGIN_OPTION"
|
||||
|
||||
test -f $DAEMON || exit 0
|
||||
|
||||
# FIXME: any of the sourced files may fail if/with syntax errors
|
||||
test -f /etc/default/bluetooth && . /etc/default/bluetooth
|
||||
test -f /etc/default/rcS && . /etc/default/rcS
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
set -e
|
||||
|
||||
# FIXME: this function is possibly a no-op
|
||||
run_sdptool()
|
||||
{
|
||||
# declaring IFS local in this function, removes the need to
|
||||
# save/restore it
|
||||
local IFS o
|
||||
|
||||
test -x $SDPTOOL || return 1
|
||||
|
||||
# FIXME: where does SDPTOOL_OPTIONS come from?
|
||||
if ! test -z "$SDPTOOL_OPTIONS" ; then
|
||||
IFS=";"
|
||||
for o in $SDPTOOL_OPTIONS ; do
|
||||
#echo "execing $SDPTOOL $o"
|
||||
IFS=" "
|
||||
if [ "$VERBOSE" != no ]; then
|
||||
$SDPTOOL $o
|
||||
else
|
||||
$SDPTOOL $o >/dev/null 2>&1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
hci_input()
|
||||
{
|
||||
log_progress_msg "switching to HID/HCI no longer done in init script, see /usr/share/doc/bluez/NEWS.Debian.gz" || :
|
||||
}
|
||||
alias enable_hci_input=hci_input
|
||||
alias disable_hci_input=hci_input
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
log_daemon_msg "Starting $DESC"
|
||||
|
||||
if test "$BLUETOOTH_ENABLED" = 0; then
|
||||
log_progress_msg "disabled. see /etc/default/bluetooth"
|
||||
log_end_msg 0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
start-stop-daemon --start --background $SSD_OPTIONS
|
||||
log_progress_msg "${DAEMON##*/}"
|
||||
|
||||
run_sdptool || :
|
||||
|
||||
if test "$HID2HCI_ENABLED" = 1; then
|
||||
enable_hci_input
|
||||
fi
|
||||
|
||||
log_end_msg 0
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC"
|
||||
if test "$BLUETOOTH_ENABLED" = 0; then
|
||||
log_progress_msg "disabled."
|
||||
log_end_msg 0
|
||||
exit 0
|
||||
fi
|
||||
if test "$HID2HCI_UNDO" = 1; then
|
||||
disable_hci_input
|
||||
fi
|
||||
start-stop-daemon --stop $SSD_OPTIONS
|
||||
log_progress_msg "${DAEMON}"
|
||||
log_end_msg 0
|
||||
;;
|
||||
restart|force-reload)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$DESC" && exit 0 || exit $?
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/bluetooth
|
||||
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# vim:noet
|
||||
Executable
+63
@@ -0,0 +1,63 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
|
||||
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
|
||||
# conditions defined in the file COPYING, which is part of this source code package.
|
||||
|
||||
# Startskript for OMD sites
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: omd-2.0.0p24.cfe
|
||||
# Required-Start: $syslog
|
||||
# Required-Stop: $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: OMD sites
|
||||
# Description: Start and stop the sites of the OpenSource Monitoring
|
||||
# Distribution (OMD)
|
||||
### END INIT INFO
|
||||
|
||||
# -- start omd, if not disabled in /etc/default/omd
|
||||
AUTOSTART=1
|
||||
[ -r /etc/default/omd ] && . /etc/default/omd
|
||||
|
||||
VERSION=2.0.0p24.cfe
|
||||
VER="-V $VERSION"
|
||||
MSG="using omd version $VERSION"
|
||||
OMD="/omd/versions/$VERSION/bin/omd"
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if [ "$AUTOSTART" = "1" ]; then
|
||||
echo "Starting all OMD monitoring sites $MSG:"
|
||||
$OMD "$1" $VER
|
||||
else
|
||||
echo "OMD autostart disabled, skipping ..."
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping all OMD monitoring sites $MSG:"
|
||||
$OMD "$1" $VER
|
||||
;;
|
||||
restart)
|
||||
echo "Restarting all OMD monitoring sites $MSG:"
|
||||
$OMD "$1" $VER
|
||||
;;
|
||||
reload)
|
||||
echo "Reloading all OMD monitoring sites $MSG:"
|
||||
$OMD "$1" $VER
|
||||
;;
|
||||
status)
|
||||
echo "Checking state of all OMD monitoring sites $MSG:"
|
||||
$OMD "$1" $VER
|
||||
;;
|
||||
'')
|
||||
echo "usage: $PROGNAME start|stop|restart|reload|status"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "Doing $1 on all OMD monitoring sites $MSG:"
|
||||
$OMD "$1" $VER
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: console-setup.sh
|
||||
# Required-Start: $remote_fs
|
||||
# Required-Stop:
|
||||
# Should-Start: console-screen kbd
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop:
|
||||
# X-Interactive: true
|
||||
# Short-Description: Set console font and keymap
|
||||
### END INIT INFO
|
||||
|
||||
if [ -f /bin/setupcon ]; then
|
||||
case "$1" in
|
||||
stop|status)
|
||||
# console-setup isn't a daemon
|
||||
;;
|
||||
start|force-reload|restart|reload)
|
||||
if [ -f /lib/lsb/init-functions ]; then
|
||||
. /lib/lsb/init-functions
|
||||
else
|
||||
log_action_begin_msg () {
|
||||
echo -n "$@... "
|
||||
}
|
||||
|
||||
log_action_end_msg () {
|
||||
if [ "$1" -eq 0 ]; then
|
||||
echo done.
|
||||
else
|
||||
echo failed.
|
||||
fi
|
||||
}
|
||||
fi
|
||||
log_action_begin_msg "Setting up console font and keymap"
|
||||
if /lib/console-setup/console-setup.sh; then
|
||||
log_action_end_msg 0
|
||||
else
|
||||
log_action_end_msg $?
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo 'Usage: /etc/init.d/console-setup {start|reload|restart|force-reload|stop|status}'
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
#!/bin/sh
|
||||
# Start/stop the cron daemon.
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: cron
|
||||
# Required-Start: $remote_fs $syslog $time
|
||||
# Required-Stop: $remote_fs $syslog $time
|
||||
# Should-Start: $network $named slapd autofs ypbind nscd nslcd winbind sssd
|
||||
# Should-Stop: $network $named slapd autofs ypbind nscd nslcd winbind sssd
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop:
|
||||
# Short-Description: Regular background program processing daemon
|
||||
# Description: cron is a standard UNIX program that runs user-specified
|
||||
# programs at periodic scheduled times. vixie cron adds a
|
||||
# number of features to the basic UNIX cron, including better
|
||||
# security and more powerful configuration options.
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||
DESC="cron daemon"
|
||||
NAME=cron
|
||||
DAEMON=/usr/sbin/cron
|
||||
PIDFILE=/var/run/crond.pid
|
||||
SCRIPTNAME=/etc/init.d/"$NAME"
|
||||
|
||||
test -f $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
[ -r /etc/default/cron ] && . /etc/default/cron
|
||||
|
||||
# Read the system's locale and set cron's locale. This is only used for
|
||||
# setting the charset of mails generated by cron. To provide locale
|
||||
# information to tasks running under cron, see /etc/pam.d/cron.
|
||||
#
|
||||
# We read /etc/environment, but warn about locale information in
|
||||
# there because it should be in /etc/default/locale.
|
||||
parse_environment ()
|
||||
{
|
||||
for ENV_FILE in /etc/environment /etc/default/locale; do
|
||||
[ -r "$ENV_FILE" ] || continue
|
||||
[ -s "$ENV_FILE" ] || continue
|
||||
|
||||
for var in LANG LANGUAGE LC_ALL LC_CTYPE; do
|
||||
value=`egrep "^${var}=" "$ENV_FILE" | tail -n1 | cut -d= -f2`
|
||||
[ -n "$value" ] && eval export $var=$value
|
||||
|
||||
if [ -n "$value" ] && [ "$ENV_FILE" = /etc/environment ]; then
|
||||
log_warning_msg "/etc/environment has been deprecated for locale information; use /etc/default/locale for $var=$value instead"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# Get the timezone set.
|
||||
if [ -z "$TZ" -a -e /etc/timezone ]; then
|
||||
TZ=`cat /etc/timezone`
|
||||
fi
|
||||
}
|
||||
|
||||
# Parse the system's environment
|
||||
if [ "$READ_ENV" = "yes" ] ; then
|
||||
parse_environment
|
||||
fi
|
||||
|
||||
|
||||
case "$1" in
|
||||
start) log_daemon_msg "Starting periodic command scheduler" "cron"
|
||||
start_daemon -p $PIDFILE $DAEMON $EXTRA_OPTS
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop) log_daemon_msg "Stopping periodic command scheduler" "cron"
|
||||
killproc -p $PIDFILE $DAEMON
|
||||
RETVAL=$?
|
||||
[ $RETVAL -eq 0 ] && [ -e "$PIDFILE" ] && rm -f $PIDFILE
|
||||
log_end_msg $RETVAL
|
||||
;;
|
||||
restart) log_daemon_msg "Restarting periodic command scheduler" "cron"
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
reload|force-reload) log_daemon_msg "Reloading configuration files for periodic command scheduler" "cron"
|
||||
# cron reloads automatically
|
||||
log_end_msg 0
|
||||
;;
|
||||
status)
|
||||
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
|
||||
;;
|
||||
*) log_action_msg "Usage: /etc/init.d/cron {start|stop|status|restart|reload|force-reload}"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#! /bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: cryptdisks
|
||||
# Required-Start: checkroot cryptdisks-early
|
||||
# Required-Stop: umountroot cryptdisks-early
|
||||
# Should-Start: udev mdadm-raid lvm2
|
||||
# Should-Stop: udev mdadm-raid lvm2
|
||||
# X-Start-Before: checkfs
|
||||
# X-Stop-After: umountfs
|
||||
# X-Interactive: true
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Setup remaining encrypted block devices.
|
||||
# Description:
|
||||
### END INIT INFO
|
||||
|
||||
set -e
|
||||
|
||||
if [ -r /lib/cryptsetup/cryptdisks-functions ]; then
|
||||
. /lib/cryptsetup/cryptdisks-functions
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
INITSTATE="remaining"
|
||||
DEFAULT_LOUD="yes"
|
||||
|
||||
case "$CRYPTDISKS_ENABLE" in
|
||||
[Nn]*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
do_start
|
||||
;;
|
||||
stop)
|
||||
do_stop
|
||||
;;
|
||||
restart|reload|force-reload)
|
||||
do_stop
|
||||
do_start
|
||||
;;
|
||||
force-start)
|
||||
FORCE_START="yes"
|
||||
do_start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: cryptdisks {start|stop|restart|reload|force-reload|force-start}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#! /bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: cryptdisks-early
|
||||
# Required-Start: checkroot
|
||||
# Required-Stop: umountroot
|
||||
# Should-Start: udev mdadm-raid
|
||||
# Should-Stop: udev mdadm-raid
|
||||
# X-Start-Before: lvm2
|
||||
# X-Stop-After: lvm2 umountfs
|
||||
# X-Interactive: true
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Setup early encrypted block devices.
|
||||
# Description:
|
||||
### END INIT INFO
|
||||
|
||||
set -e
|
||||
|
||||
if [ -r /lib/cryptsetup/cryptdisks-functions ]; then
|
||||
. /lib/cryptsetup/cryptdisks-functions
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
INITSTATE="early"
|
||||
DEFAULT_LOUD=""
|
||||
|
||||
case "$CRYPTDISKS_ENABLE" in
|
||||
[Nn]*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
do_start
|
||||
;;
|
||||
stop)
|
||||
do_stop
|
||||
;;
|
||||
restart|reload|force-reload)
|
||||
do_stop
|
||||
do_start
|
||||
;;
|
||||
force-start)
|
||||
FORCE_START="yes"
|
||||
do_start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: cryptdisks-early {start|stop|restart|reload|force-reload|force-start}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Executable
+95
@@ -0,0 +1,95 @@
|
||||
#! /bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: cups
|
||||
# Required-Start: $syslog $remote_fs
|
||||
# Required-Stop: $syslog $remote_fs
|
||||
# Should-Start: $network avahi-daemon slapd nslcd
|
||||
# Should-Stop: $network
|
||||
# X-Start-Before: samba
|
||||
# X-Stop-After: samba
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 1
|
||||
# Short-Description: CUPS Printing spooler and server
|
||||
# Description: Manage the CUPS Printing spooler and server;
|
||||
# make it's web interface accessible on http://localhost:631/
|
||||
### END INIT INFO
|
||||
|
||||
# Author: Debian Printing Team <debian-printing@lists.debian.org>
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DAEMON=/usr/sbin/cupsd
|
||||
NAME=cupsd
|
||||
PIDFILE=/run/cups/$NAME.pid
|
||||
DESC="Common Unix Printing System"
|
||||
SCRIPTNAME=/etc/init.d/cups
|
||||
|
||||
unset TMPDIR
|
||||
|
||||
# Exit if the package is not installed
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
mkdir -p /run/cups/certs
|
||||
[ -x /sbin/restorecon ] && /sbin/restorecon -R /run/cups
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
|
||||
# and status_of_proc is working.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
# Get the timezone set.
|
||||
if [ -z "$TZ" -a -e /etc/timezone ]; then
|
||||
TZ=`cat /etc/timezone`
|
||||
export TZ
|
||||
fi
|
||||
|
||||
coldplug_usb_printers() {
|
||||
if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then
|
||||
for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \
|
||||
--attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \
|
||||
udevadm trigger --verbose --dry-run --subsystem-match=usb \
|
||||
--sysname-match='lp[0-9]*' 2>/dev/null || true`; do
|
||||
/lib/udev/udev-configure-printer add "${printer#/sys}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting $DESC" "$NAME"
|
||||
|
||||
mkdir -p `dirname "$PIDFILE"`
|
||||
start-stop-daemon --start --quiet --oknodo --pidfile "$PIDFILE" --exec $DAEMON
|
||||
status=$?
|
||||
[ $status = 0 ] && coldplug_usb_printers
|
||||
log_end_msg $status
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
start-stop-daemon --stop --quiet --retry 5 --oknodo --pidfile $PIDFILE --name $NAME
|
||||
status=$?
|
||||
log_end_msg $status
|
||||
;;
|
||||
reload|force-reload)
|
||||
log_daemon_msg "Reloading $DESC" "$NAME"
|
||||
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME --signal 1
|
||||
status=$?
|
||||
log_end_msg $status
|
||||
;;
|
||||
restart)
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
if start-stop-daemon --stop --quiet --retry 5 --oknodo --pidfile $PIDFILE --name $NAME; then
|
||||
start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec $DAEMON
|
||||
fi
|
||||
status=$?
|
||||
log_end_msg $status
|
||||
;;
|
||||
status)
|
||||
status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+64
@@ -0,0 +1,64 @@
|
||||
#! /bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: cups-browsed
|
||||
# Required-Start: $syslog $remote_fs $network $named $time
|
||||
# Required-Stop: $syslog $remote_fs $network $named $time
|
||||
# Should-Start: avahi-daemon
|
||||
# Should-Stop: avahi-daemon
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: cups-browsed - Make remote CUPS printers available locally
|
||||
# Description: This daemon browses Bonjour broadcasts of shared remote CUPS
|
||||
# printers and makes these printers available locally by creating
|
||||
# local CUPS queues pointing to the remote queues. This replaces
|
||||
# the CUPS browsing which was dropped in CUPS 1.6.1. For the end
|
||||
# the behavior is the same as with the old CUPS broadcasting/
|
||||
# browsing, but in the background the standard method for network
|
||||
# service announcement and discovery, Bonjour, is used.
|
||||
### END INIT INFO
|
||||
|
||||
DAEMON=/usr/sbin/cups-browsed
|
||||
NAME=cups-browsed
|
||||
PIDFILE=/var/run/cups/$NAME.pid
|
||||
DESC="CUPS Bonjour daemon"
|
||||
|
||||
unset TMPDIR
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
SSD_OPTIONS="--quiet --pidfile $PIDFILE --make-pidfile"
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_begin_msg "Starting $DESC: $NAME"
|
||||
|
||||
mkdir -p `dirname "$PIDFILE"`
|
||||
start-stop-daemon --start --oknodo --background $SSD_OPTIONS --exec $DAEMON
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop)
|
||||
log_begin_msg "Stopping $DESC: $NAME"
|
||||
start-stop-daemon --stop --retry 5 --oknodo $SSD_OPTIONS --name $NAME
|
||||
log_end_msg $?
|
||||
rm -f $PIDFILE
|
||||
;;
|
||||
restart|force-reload)
|
||||
log_begin_msg "Restarting $DESC: $NAME"
|
||||
if start-stop-daemon --stop --retry 5 --oknodo $SSD_OPTIONS --name $NAME; then
|
||||
start-stop-daemon --start --background $SSD_OPTIONS --exec $DAEMON
|
||||
fi
|
||||
log_end_msg $?
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/${0##*/}
|
||||
echo "Usage: $N {start|stop|force-reload|restart|status}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+129
@@ -0,0 +1,129 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: dbus
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop:
|
||||
# Short-Description: D-Bus systemwide message bus
|
||||
# Description: D-Bus is a simple interprocess messaging system, used
|
||||
# for sending messages between applications.
|
||||
### END INIT INFO
|
||||
# -*- coding: utf-8 -*-
|
||||
# Debian init.d script for D-BUS
|
||||
# Copyright © 2003 Colin Walters <walters@debian.org>
|
||||
# Copyright © 2005 Sjoerd Simons <sjoerd@debian.org>
|
||||
|
||||
set -e
|
||||
|
||||
DAEMON=/usr/bin/dbus-daemon
|
||||
UUIDGEN=/usr/bin/dbus-uuidgen
|
||||
UUIDGEN_OPTS=--ensure
|
||||
NAME=dbus
|
||||
DAEMONUSER=messagebus
|
||||
PIDDIR=/var/run/dbus
|
||||
PIDFILE=$PIDDIR/pid
|
||||
DESC="system message bus"
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
# Source defaults file; edit that file to configure this script.
|
||||
PARAMS=""
|
||||
if [ -e /etc/default/dbus ]; then
|
||||
. /etc/default/dbus
|
||||
fi
|
||||
|
||||
create_machineid() {
|
||||
# Create machine-id file
|
||||
if [ -x $UUIDGEN ]; then
|
||||
$UUIDGEN $UUIDGEN_OPTS
|
||||
fi
|
||||
}
|
||||
|
||||
start_it_up()
|
||||
{
|
||||
if [ ! -d $PIDDIR ]; then
|
||||
mkdir -p $PIDDIR
|
||||
chown $DAEMONUSER $PIDDIR
|
||||
chgrp $DAEMONUSER $PIDDIR
|
||||
fi
|
||||
|
||||
if ! mountpoint -q /proc/ ; then
|
||||
log_failure_msg "Can't start $DESC - /proc is not mounted"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -e $PIDFILE ]; then
|
||||
if $0 status > /dev/null ; then
|
||||
log_success_msg "$DESC already started; not starting."
|
||||
return
|
||||
else
|
||||
log_success_msg "Removing stale PID file $PIDFILE."
|
||||
rm -f $PIDFILE
|
||||
fi
|
||||
fi
|
||||
|
||||
create_machineid
|
||||
|
||||
# Force libnss-systemd to avoid trying to communicate via D-Bus, which
|
||||
# is never going to work well from within dbus-daemon. systemd
|
||||
# special-cases this internally, but we might need to do the same when
|
||||
# booting with sysvinit if libnss-systemd is still installed.
|
||||
# (Workaround for #940971)
|
||||
export SYSTEMD_NSS_BYPASS_BUS=1
|
||||
|
||||
log_daemon_msg "Starting $DESC" "$NAME"
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE \
|
||||
--exec $DAEMON -- --system $PARAMS
|
||||
log_end_msg $?
|
||||
}
|
||||
|
||||
shut_it_down()
|
||||
{
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
start-stop-daemon --stop --retry 5 --quiet --oknodo --pidfile $PIDFILE \
|
||||
--user $DAEMONUSER
|
||||
# We no longer include these arguments so that start-stop-daemon
|
||||
# can do its job even given that we may have been upgraded.
|
||||
# We rely on the pidfile being sanely managed
|
||||
# --exec $DAEMON -- --system $PARAMS
|
||||
log_end_msg $?
|
||||
rm -f $PIDFILE
|
||||
}
|
||||
|
||||
reload_it()
|
||||
{
|
||||
create_machineid
|
||||
log_action_begin_msg "Reloading $DESC config"
|
||||
dbus-send --print-reply --system --type=method_call \
|
||||
--dest=org.freedesktop.DBus \
|
||||
/ org.freedesktop.DBus.ReloadConfig > /dev/null
|
||||
# hopefully this is enough time for dbus to reload it's config file.
|
||||
log_action_end_msg $?
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start_it_up
|
||||
;;
|
||||
stop)
|
||||
shut_it_down
|
||||
;;
|
||||
reload|force-reload)
|
||||
reload_it
|
||||
;;
|
||||
restart)
|
||||
shut_it_down
|
||||
start_it_up
|
||||
;;
|
||||
status)
|
||||
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload|status}" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
Executable
+156
@@ -0,0 +1,156 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: docker
|
||||
# Required-Start: $syslog $remote_fs
|
||||
# Required-Stop: $syslog $remote_fs
|
||||
# Should-Start: cgroupfs-mount cgroup-lite
|
||||
# Should-Stop: cgroupfs-mount cgroup-lite
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Create lightweight, portable, self-sufficient containers.
|
||||
# Description:
|
||||
# Docker is an open-source project to easily create lightweight, portable,
|
||||
# self-sufficient containers from any application. The same container that a
|
||||
# developer builds and tests on a laptop can run at scale, in production, on
|
||||
# VMs, bare metal, OpenStack clusters, public clouds and more.
|
||||
### END INIT INFO
|
||||
|
||||
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
||||
|
||||
BASE=docker
|
||||
|
||||
# modify these in /etc/default/$BASE (/etc/default/docker)
|
||||
DOCKERD=/usr/bin/dockerd
|
||||
# This is the pid file managed by docker itself
|
||||
DOCKER_PIDFILE=/var/run/$BASE.pid
|
||||
# This is the pid file created/managed by start-stop-daemon
|
||||
DOCKER_SSD_PIDFILE=/var/run/$BASE-ssd.pid
|
||||
DOCKER_LOGFILE=/var/log/$BASE.log
|
||||
DOCKER_OPTS=
|
||||
DOCKER_DESC="Docker"
|
||||
|
||||
# Get lsb functions
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
if [ -f /etc/default/$BASE ]; then
|
||||
. /etc/default/$BASE
|
||||
fi
|
||||
|
||||
# Check docker is present
|
||||
if [ ! -x $DOCKERD ]; then
|
||||
log_failure_msg "$DOCKERD not present or not executable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
check_init() {
|
||||
# see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it directly)
|
||||
if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | grep -q upstart; then
|
||||
log_failure_msg "$DOCKER_DESC is managed via upstart, try using service $BASE $1"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
fail_unless_root() {
|
||||
if [ "$(id -u)" != '0' ]; then
|
||||
log_failure_msg "$DOCKER_DESC must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
cgroupfs_mount() {
|
||||
# see also https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount
|
||||
if grep -v '^#' /etc/fstab | grep -q cgroup \
|
||||
|| [ ! -e /proc/cgroups ] \
|
||||
|| [ ! -d /sys/fs/cgroup ]; then
|
||||
return
|
||||
fi
|
||||
if ! mountpoint -q /sys/fs/cgroup; then
|
||||
mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup
|
||||
fi
|
||||
(
|
||||
cd /sys/fs/cgroup
|
||||
for sys in $(awk '!/^#/ { if ($4 == 1) print $1 }' /proc/cgroups); do
|
||||
mkdir -p $sys
|
||||
if ! mountpoint -q $sys; then
|
||||
if ! mount -n -t cgroup -o $sys cgroup $sys; then
|
||||
rmdir $sys || true
|
||||
fi
|
||||
fi
|
||||
done
|
||||
)
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
check_init
|
||||
|
||||
fail_unless_root
|
||||
|
||||
cgroupfs_mount
|
||||
|
||||
touch "$DOCKER_LOGFILE"
|
||||
chgrp docker "$DOCKER_LOGFILE"
|
||||
|
||||
ulimit -n 1048576
|
||||
|
||||
# Having non-zero limits causes performance problems due to accounting overhead
|
||||
# in the kernel. We recommend using cgroups to do container-local accounting.
|
||||
if [ "$BASH" ]; then
|
||||
ulimit -u unlimited
|
||||
else
|
||||
ulimit -p unlimited
|
||||
fi
|
||||
|
||||
log_begin_msg "Starting $DOCKER_DESC: $BASE"
|
||||
start-stop-daemon --start --background \
|
||||
--no-close \
|
||||
--exec "$DOCKERD" \
|
||||
--pidfile "$DOCKER_SSD_PIDFILE" \
|
||||
--make-pidfile \
|
||||
-- \
|
||||
-p "$DOCKER_PIDFILE" \
|
||||
$DOCKER_OPTS \
|
||||
>> "$DOCKER_LOGFILE" 2>&1
|
||||
log_end_msg $?
|
||||
;;
|
||||
|
||||
stop)
|
||||
check_init
|
||||
fail_unless_root
|
||||
if [ -f "$DOCKER_SSD_PIDFILE" ]; then
|
||||
log_begin_msg "Stopping $DOCKER_DESC: $BASE"
|
||||
start-stop-daemon --stop --pidfile "$DOCKER_SSD_PIDFILE" --retry 10
|
||||
log_end_msg $?
|
||||
else
|
||||
log_warning_msg "Docker already stopped - file $DOCKER_SSD_PIDFILE not found."
|
||||
fi
|
||||
;;
|
||||
|
||||
restart)
|
||||
check_init
|
||||
fail_unless_root
|
||||
docker_pid=`cat "$DOCKER_SSD_PIDFILE" 2>/dev/null`
|
||||
[ -n "$docker_pid" ] \
|
||||
&& ps -p $docker_pid > /dev/null 2>&1 \
|
||||
&& $0 stop
|
||||
$0 start
|
||||
;;
|
||||
|
||||
force-reload)
|
||||
check_init
|
||||
fail_unless_root
|
||||
$0 restart
|
||||
;;
|
||||
|
||||
status)
|
||||
check_init
|
||||
status_of_proc -p "$DOCKER_SSD_PIDFILE" "$DOCKERD" "$DOCKER_DESC"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: service docker {start|stop|restart|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ftscanhvd
|
||||
# Required-Start: $local_fs $all
|
||||
# Required-Stop: $local_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: This services starts and stops the ftscanhvd.
|
||||
### END INIT INFO
|
||||
|
||||
set -e
|
||||
|
||||
BIN_DIR="/usr/lib/vmware/view/bin"
|
||||
DAEMON_NAME="ftscanhvd"
|
||||
|
||||
# Check permissions
|
||||
if [ "`id -ur`" != '0' ]
|
||||
then
|
||||
echo 'Error: you must be root.'
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if [ -x $BIN_DIR/$DAEMON_NAME ]
|
||||
then
|
||||
$BIN_DIR/$DAEMON_NAME
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
killall $DAEMON_NAME
|
||||
;;
|
||||
restart)
|
||||
killall -KILL $DAEMON_NAME
|
||||
if [ -x $BIN_DIR/$DAEMON_NAME ]
|
||||
then
|
||||
$BIN_DIR/$DAEMON_NAME
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ftsprhvd
|
||||
# Required-Start: $local_fs $all
|
||||
# Required-Stop: $local_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: This services starts and stops the ftsprhvd.
|
||||
### END INIT INFO
|
||||
|
||||
set -e
|
||||
|
||||
BIN_DIR="/usr/lib/vmware/view/bin"
|
||||
DAEMON_NAME="ftsprhvd"
|
||||
|
||||
# Check permissions
|
||||
if [ "`id -ur`" != '0' ]
|
||||
then
|
||||
echo 'Error: you must be root.'
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if [ -x $BIN_DIR/$DAEMON_NAME ]
|
||||
then
|
||||
$BIN_DIR/$DAEMON_NAME
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
killall -KILL $DAEMON_NAME
|
||||
;;
|
||||
restart)
|
||||
killall -KILL $DAEMON_NAME
|
||||
if [ -x $BIN_DIR/$DAEMON_NAME ]
|
||||
then
|
||||
$BIN_DIR/$DAEMON_NAME
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
Executable
+57
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: hwclock
|
||||
# Required-Start:
|
||||
# Required-Stop: mountdevsubfs
|
||||
# Should-Stop: umountfs
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Save system clock to hardware on shutdown.
|
||||
### END INIT INFO
|
||||
|
||||
# Note: this init script and related code is only useful if you
|
||||
# run a sysvinit system, without NTP synchronization.
|
||||
|
||||
if [ -e /run/systemd/system ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
unset TZ
|
||||
|
||||
hwclocksh()
|
||||
{
|
||||
HCTOSYS_DEVICE=rtc0
|
||||
[ ! -x /sbin/hwclock ] && return 0
|
||||
[ ! -r /etc/default/rcS ] || . /etc/default/rcS
|
||||
[ ! -r /etc/default/hwclock ] || . /etc/default/hwclock
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
verbose_log_action_msg() { [ "$VERBOSE" = no ] || log_action_msg "$@"; }
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
# start is handled by /usr/lib/udev/rules.d/85-hwclock.rules.
|
||||
return 0
|
||||
;;
|
||||
stop|restart|reload|force-reload)
|
||||
# Updates the Hardware Clock with the System Clock time.
|
||||
# This will *override* any changes made to the Hardware Clock,
|
||||
# for example by the Linux kernel when NTP is in use.
|
||||
log_action_msg "Saving the system clock to /dev/$HCTOSYS_DEVICE"
|
||||
if /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --systohc; then
|
||||
verbose_log_action_msg "Hardware Clock updated to `date`"
|
||||
fi
|
||||
;;
|
||||
show)
|
||||
/sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --show
|
||||
;;
|
||||
*)
|
||||
log_success_msg "Usage: hwclock.sh {stop|reload|force-reload|show}"
|
||||
log_success_msg " stop and reload set hardware (RTC) clock from kernel (system) clock"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
hwclocksh "$@"
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: keyboard-setup.sh
|
||||
# Required-Start: mountkernfs
|
||||
# Required-Stop:
|
||||
# X-Start-Before: checkroot
|
||||
# Default-Start: S
|
||||
# Default-Stop:
|
||||
# X-Interactive: true
|
||||
# Short-Description: Set the console keyboard layout
|
||||
# Description: Set the console keyboard as early as possible
|
||||
# so during the file systems checks the administrator
|
||||
# can interact. At this stage of the boot process
|
||||
# only the ASCII symbols are supported.
|
||||
### END INIT INFO
|
||||
|
||||
if [ -f /bin/setupcon ]; then
|
||||
case "$1" in
|
||||
stop|status)
|
||||
# console-setup isn't a daemon
|
||||
;;
|
||||
start|force-reload|restart|reload)
|
||||
if [ -f /lib/lsb/init-functions ]; then
|
||||
. /lib/lsb/init-functions
|
||||
else
|
||||
log_action_begin_msg () {
|
||||
echo -n "$@... "
|
||||
}
|
||||
|
||||
log_action_end_msg () {
|
||||
if [ "$1" -eq 0 ]; then
|
||||
echo done.
|
||||
else
|
||||
echo failed.
|
||||
fi
|
||||
}
|
||||
fi
|
||||
log_action_begin_msg "Setting up keyboard layout"
|
||||
if /lib/console-setup/keyboard-setup.sh; then
|
||||
log_action_end_msg 0
|
||||
else
|
||||
log_action_end_msg $?
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo 'Usage: /etc/init.d/keyboard-setup {start|reload|restart|force-reload|stop|status}'
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
#!/bin/sh -e
|
||||
### BEGIN INIT INFO
|
||||
# Provides: kmod
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Should-Start: checkroot
|
||||
# Should-Stop:
|
||||
# Default-Start: S
|
||||
# Default-Stop:
|
||||
# Short-Description: Load the modules listed in /etc/modules.
|
||||
# Description: Load the modules listed in /etc/modules.
|
||||
### END INIT INFO
|
||||
|
||||
# Silently exit if the kernel does not support modules.
|
||||
[ -f /proc/modules ] || exit 0
|
||||
[ -x /sbin/modprobe ] || exit 0
|
||||
|
||||
[ -f /etc/default/rcS ] && . /etc/default/rcS
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
PATH='/sbin:/bin'
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
;;
|
||||
|
||||
stop|restart|reload|force-reload)
|
||||
log_warning_msg "Action '$1' is meaningless for this init script"
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
log_success_msg "Usage: $0 start"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
load_module() {
|
||||
local module args
|
||||
module="$1"
|
||||
args="$2"
|
||||
|
||||
if [ "$VERBOSE" != no ]; then
|
||||
log_action_msg "Loading kernel module $module"
|
||||
modprobe $module $args || true
|
||||
else
|
||||
modprobe $module $args > /dev/null 2>&1 || true
|
||||
fi
|
||||
}
|
||||
|
||||
modules_files() {
|
||||
local modules_load_dirs='/etc/modules-load.d /run/modules-load.d /usr/local/lib/modules-load.d /usr/lib/modules-load.d /lib/modules-load.d'
|
||||
local processed=' '
|
||||
local add_etc_modules=true
|
||||
|
||||
for dir in $modules_load_dirs; do
|
||||
[ -d $dir ] || continue
|
||||
for file in $(run-parts --list --regex='\.conf$' $dir 2> /dev/null || true); do
|
||||
local base=${file##*/}
|
||||
if echo -n "$processed" | grep -qF " $base "; then
|
||||
continue
|
||||
fi
|
||||
if [ "$add_etc_modules" -a -L $file \
|
||||
-a "$(readlink -f $file)" = /etc/modules ]; then
|
||||
add_etc_modules=
|
||||
fi
|
||||
processed="$processed$base "
|
||||
echo $file
|
||||
done
|
||||
done
|
||||
|
||||
if [ "$add_etc_modules" ]; then
|
||||
echo /etc/modules
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$VERBOSE" = no ]; then
|
||||
log_action_begin_msg 'Loading kernel modules'
|
||||
fi
|
||||
|
||||
files=$(modules_files)
|
||||
if [ "$files" ] ; then
|
||||
grep -h '^[^#]' $files |
|
||||
while read module args; do
|
||||
[ "$module" ] || continue
|
||||
load_module "$module" "$args"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$VERBOSE" = no ]; then
|
||||
log_action_end_msg 0
|
||||
fi
|
||||
|
||||
Executable
+80
@@ -0,0 +1,80 @@
|
||||
#! /bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: lightdm
|
||||
# Should-Start: console-screen kbd acpid dbus hal consolekit
|
||||
# Required-Start: $local_fs $remote_fs x11-common
|
||||
# Required-Stop: $local_fs $remote_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Light Display Manager
|
||||
# Description: Debian init script for the Light Display Manager
|
||||
### END INIT INFO
|
||||
#
|
||||
# Author: Yves-Alexis Perez <corsac@debian.org> using gdm script from
|
||||
# Ryan Murray <rmurray@debian.org>
|
||||
#
|
||||
set -e
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DAEMON=/usr/sbin/lightdm
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
if [ -r /etc/default/locale ]; then
|
||||
. /etc/default/locale
|
||||
export LANG LANGUAGE
|
||||
fi
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
# To start lightdm even if it is not the default display manager, change
|
||||
# HEED_DEFAULT_DISPLAY_MANAGER to "false."
|
||||
HEED_DEFAULT_DISPLAY_MANAGER=true
|
||||
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
CONFIGURED_DAEMON=$(basename "$(cat $DEFAULT_DISPLAY_MANAGER_FILE 2> /dev/null)")
|
||||
if grep -wqs text /proc/cmdline; then
|
||||
log_warning_msg "Not starting Light Display Manager (lightdm); found 'text' in kernel commandline."
|
||||
elif [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ] && \
|
||||
[ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] && \
|
||||
[ "$CONFIGURED_DAEMON" != lightdm ] ; then
|
||||
log_action_msg "Not starting Light Display Manager; it is not the default display manager"
|
||||
else
|
||||
log_daemon_msg "Starting Light Display Manager" "lightdm"
|
||||
start-stop-daemon --start --quiet --pidfile /var/run/lightdm.pid --name lightdm --exec $DAEMON -b|| echo -n " already running"
|
||||
log_end_msg $?
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping Light Display Manager" "lightdm"
|
||||
set +e
|
||||
start-stop-daemon --stop --quiet --pidfile /var/run/lightdm.pid \
|
||||
--name lightdm --retry 5
|
||||
set -e
|
||||
log_end_msg $?
|
||||
;;
|
||||
reload)
|
||||
log_daemon_msg "Scheduling reload of Light Display Manager configuration" "lightdm"
|
||||
set +e
|
||||
start-stop-daemon --stop --signal USR1 --quiet --pidfile \
|
||||
/var/run/lightdm.pid --name lightdm
|
||||
set -e
|
||||
log_end_msg $?
|
||||
;;
|
||||
status)
|
||||
status_of_proc -p "$PIDFILE" "$DAEMON" lightdm && exit 0 || exit $?
|
||||
;;
|
||||
restart|force-reload)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/lightdm {start|stop|restart|reload|force-reload|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: lvm2 lvm
|
||||
# Required-Start: mountdevsubfs
|
||||
# Required-Stop:
|
||||
# Should-Start: udev mdadm-raid cryptdisks-early multipath-tools-boot
|
||||
# Should-Stop: umountroot mdadm-raid
|
||||
# X-Start-Before: checkfs mountall
|
||||
# X-Stop-After: umountfs
|
||||
# Default-Start: S
|
||||
# Default-Stop:
|
||||
### END INIT INFO
|
||||
|
||||
SCRIPTNAME=/etc/init.d/lvm2
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
[ -x /sbin/vgchange ] || exit 0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_action_begin_msg "Setting up LVM Volume Groups"
|
||||
/sbin/lvm vgchange -aay --sysinit >/dev/null
|
||||
log_action_end_msg "$?"
|
||||
;;
|
||||
stop|restart|force-reload|status)
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME start" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
|
||||
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
|
||||
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
|
||||
fi
|
||||
### BEGIN INIT INFO
|
||||
# Provides: lvm2-lvmpolld
|
||||
# Required-Start: $local_fs
|
||||
# Required-Stop: $local_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: LVM2 poll daemon
|
||||
### END INIT INFO
|
||||
|
||||
DESC="LVM2 poll daemon"
|
||||
DAEMON=/sbin/lvmpolld
|
||||
DAEMON_ARGS="-t 60"
|
||||
PIDFILE=/run/lvmpolld.pid
|
||||
|
||||
do_start_prepare() {
|
||||
mkdir -m 0700 -p /run/lvm
|
||||
}
|
||||
Executable
+195
@@ -0,0 +1,195 @@
|
||||
#!/bin/sh -e
|
||||
### BEGIN INIT INFO
|
||||
# Provides: networking ifupdown
|
||||
# Required-Start: mountkernfs $local_fs urandom
|
||||
# Required-Stop: $local_fs
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Raise network interfaces.
|
||||
# Description: Prepare /run/network directory, ifstate file and raise network interfaces, or take them down.
|
||||
### END INIT INFO
|
||||
|
||||
PATH="/sbin:/bin"
|
||||
RUN_DIR="/run/network"
|
||||
IFSTATE="$RUN_DIR/ifstate"
|
||||
STATEDIR="$RUN_DIR/state"
|
||||
|
||||
[ -x /sbin/ifup ] || exit 0
|
||||
[ -x /sbin/ifdown ] || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
CONFIGURE_INTERFACES=yes
|
||||
EXCLUDE_INTERFACES=
|
||||
VERBOSE=no
|
||||
|
||||
[ -f /etc/default/networking ] && . /etc/default/networking
|
||||
|
||||
verbose=""
|
||||
[ "$VERBOSE" = yes ] && verbose=-v
|
||||
|
||||
process_exclusions() {
|
||||
set -- $EXCLUDE_INTERFACES
|
||||
exclusions=""
|
||||
for d
|
||||
do
|
||||
exclusions="-X $d $exclusions"
|
||||
done
|
||||
echo $exclusions
|
||||
}
|
||||
|
||||
process_options() {
|
||||
[ -e /etc/network/options ] || return 0
|
||||
log_warning_msg "/etc/network/options still exists and it will be IGNORED! Please use /etc/sysctl.conf instead."
|
||||
}
|
||||
|
||||
check_ifstate() {
|
||||
if [ ! -d "$RUN_DIR" ] ; then
|
||||
if ! mkdir -p "$RUN_DIR" ; then
|
||||
log_failure_msg "can't create $RUN_DIR"
|
||||
exit 1
|
||||
fi
|
||||
if ! chown root:netdev "$RUN_DIR" ; then
|
||||
log_warning_msg "can't chown $RUN_DIR"
|
||||
fi
|
||||
fi
|
||||
if [ ! -r "$IFSTATE" ] ; then
|
||||
if ! :> "$IFSTATE" ; then
|
||||
log_failure_msg "can't initialise $IFSTATE"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
check_network_file_systems() {
|
||||
[ -e /proc/mounts ] || return 0
|
||||
|
||||
if [ -e /etc/iscsi/iscsi.initramfs ]; then
|
||||
log_warning_msg "not deconfiguring network interfaces: iSCSI root is mounted."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
while read DEV MTPT FSTYPE REST; do
|
||||
case $DEV in
|
||||
/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*|curlftpfs*)
|
||||
log_warning_msg "not deconfiguring network interfaces: network devices still mounted."
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
case $FSTYPE in
|
||||
nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)
|
||||
log_warning_msg "not deconfiguring network interfaces: network file systems still mounted."
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done < /proc/mounts
|
||||
}
|
||||
|
||||
check_network_swap() {
|
||||
[ -e /proc/swaps ] || return 0
|
||||
|
||||
while read DEV MTPT FSTYPE REST; do
|
||||
case $DEV in
|
||||
/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
|
||||
log_warning_msg "not deconfiguring network interfaces: network swap still mounted."
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done < /proc/swaps
|
||||
}
|
||||
|
||||
ifup_hotplug () {
|
||||
if [ -d /sys/class/net ]
|
||||
then
|
||||
ifaces=$(for iface in $(ifquery --list --allow=hotplug)
|
||||
do
|
||||
link=${iface%%:*}
|
||||
link=${link%%.*}
|
||||
if [ -e "/sys/class/net/$link" ] && ! ifquery --state "$iface" >/dev/null
|
||||
then
|
||||
echo "$iface"
|
||||
fi
|
||||
done)
|
||||
if [ -n "$ifaces" ]
|
||||
then
|
||||
ifup $ifaces "$@" || true
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
process_options
|
||||
check_ifstate
|
||||
|
||||
if [ "$CONFIGURE_INTERFACES" = no ]
|
||||
then
|
||||
log_action_msg "Not configuring network interfaces, see /etc/default/networking"
|
||||
exit 0
|
||||
fi
|
||||
set -f
|
||||
exclusions=$(process_exclusions)
|
||||
log_action_begin_msg "Configuring network interfaces"
|
||||
if [ -x /bin/udevadm ]; then
|
||||
if [ -n "$(ifquery --list --exclude=lo)" ] || [ -n "$(ifquery --list --allow=hotplug)" ]; then
|
||||
/bin/udevadm settle || true
|
||||
fi
|
||||
fi
|
||||
if ifup -a $exclusions $verbose && ifup_hotplug $exclusions $verbose
|
||||
then
|
||||
log_action_end_msg $?
|
||||
else
|
||||
log_action_end_msg $?
|
||||
fi
|
||||
;;
|
||||
|
||||
stop)
|
||||
check_network_file_systems
|
||||
check_network_swap
|
||||
|
||||
log_action_begin_msg "Deconfiguring network interfaces"
|
||||
if ifdown -a --exclude=lo $verbose; then
|
||||
log_action_end_msg $?
|
||||
else
|
||||
log_action_end_msg $?
|
||||
fi
|
||||
;;
|
||||
|
||||
reload)
|
||||
process_options
|
||||
|
||||
log_action_begin_msg "Reloading network interfaces configuration"
|
||||
state=$(ifquery --state)
|
||||
ifdown -a --exclude=lo $verbose || true
|
||||
if ifup --exclude=lo $state $verbose ; then
|
||||
log_action_end_msg $?
|
||||
else
|
||||
log_action_end_msg $?
|
||||
fi
|
||||
;;
|
||||
|
||||
force-reload|restart)
|
||||
process_options
|
||||
|
||||
log_warning_msg "Running $0 $1 is deprecated because it may not re-enable some interfaces"
|
||||
log_action_begin_msg "Reconfiguring network interfaces"
|
||||
ifdown -a --exclude=lo $verbose || true
|
||||
set -f
|
||||
exclusions=$(process_exclusions)
|
||||
if ifup -a --exclude=lo $exclusions $verbose && ifup_hotplug $exclusions $verbose
|
||||
then
|
||||
log_action_end_msg $?
|
||||
else
|
||||
log_action_end_msg $?
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: /etc/init.d/networking {start|stop|reload|restart|force-reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# vim: noet ts=8
|
||||
Executable
+283
@@ -0,0 +1,283 @@
|
||||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: nfs-common
|
||||
# Required-Start: $portmap $time
|
||||
# Required-Stop: $time
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: NFS support files common to client and server
|
||||
# Description: NFS is a popular protocol for file sharing across
|
||||
# TCP/IP networks. This service provides various
|
||||
# support functions for NFS mounts.
|
||||
### END INIT INFO
|
||||
|
||||
# What is this?
|
||||
DESC="NFS common utilities"
|
||||
|
||||
# Read config
|
||||
DEFAULTFILE=/etc/default/nfs-common
|
||||
NEED_STATD=
|
||||
NEED_GSSD=
|
||||
PIPEFS_MOUNTPOINT=/run/rpc_pipefs
|
||||
RPCGSSDOPTS=
|
||||
if [ -f $DEFAULTFILE ]; then
|
||||
. $DEFAULTFILE
|
||||
fi
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
# Exit if required binaries are missing.
|
||||
[ -x /sbin/rpc.statd ] || exit 0
|
||||
|
||||
#
|
||||
# Parse the fstab file, and determine whether we need gssd. (The
|
||||
# /etc/defaults settings, if any, will override our autodetection.) This code
|
||||
# is partially adapted from the mountnfs.sh script in the sysvinit package.
|
||||
#
|
||||
AUTO_NEED_GSSD=no
|
||||
|
||||
if [ -f /etc/fstab ]; then
|
||||
exec 9<&0 </etc/fstab
|
||||
|
||||
while read DEV MTPT FSTYPE OPTS REST
|
||||
do
|
||||
case $DEV in
|
||||
''|\#*)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
OLDIFS="$IFS"
|
||||
IFS=","
|
||||
for OPT in $OPTS; do
|
||||
case "$OPT" in
|
||||
sec=krb5|sec=krb5i|sec=krb5p)
|
||||
AUTO_NEED_GSSD=yes
|
||||
;;
|
||||
esac
|
||||
done
|
||||
IFS="$OLDIFS"
|
||||
done
|
||||
|
||||
exec 0<&9 9<&-
|
||||
fi
|
||||
|
||||
case "$NEED_STATD" in
|
||||
yes|no)
|
||||
;;
|
||||
*)
|
||||
NEED_STATD=yes
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$NEED_IDMAPD" in
|
||||
yes|no)
|
||||
;;
|
||||
*)
|
||||
NEED_IDMAPD=yes
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$NEED_GSSD" in
|
||||
yes|no)
|
||||
;;
|
||||
*)
|
||||
NEED_GSSD=$AUTO_NEED_GSSD
|
||||
;;
|
||||
esac
|
||||
|
||||
do_modprobe() {
|
||||
if [ -x /sbin/modprobe -a -f /proc/modules ]
|
||||
then
|
||||
modprobe -q "$1" || true
|
||||
fi
|
||||
}
|
||||
|
||||
do_mount() {
|
||||
if ! grep -E -qs "$1\$" /proc/filesystems
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
if ! mountpoint -q "$2"
|
||||
then
|
||||
mount -t "$1" "$1" "$2"
|
||||
return
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
do_umount() {
|
||||
if mountpoint -q "$1"
|
||||
then
|
||||
umount "$1"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting $DESC"
|
||||
|
||||
if [ "$NEED_STATD" = yes ]; then
|
||||
log_progress_msg "statd"
|
||||
|
||||
# See if rpcbind is running
|
||||
if [ -x /usr/sbin/rpcinfo ]; then
|
||||
/usr/sbin/rpcinfo -p >/dev/null 2>&1
|
||||
RET=$?
|
||||
if [ $RET != 0 ]; then
|
||||
echo
|
||||
log_warning_msg "Not starting: portmapper is not running"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
start-stop-daemon --start --oknodo --quiet \
|
||||
--pidfile /run/rpc.statd.pid \
|
||||
--exec /sbin/rpc.statd -- $STATDOPTS
|
||||
RET=$?
|
||||
if [ $RET != 0 ]; then
|
||||
log_end_msg $RET
|
||||
exit $RET
|
||||
else
|
||||
if [ -d /run/sendsigs.omit.d ]; then
|
||||
rm -f /run/sendsigs.omit.d/statd
|
||||
ln -s /run/rpc.statd.pid /run/sendsigs.omit.d/statd
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Don't start idmapd and gssd if we don't have them (say, if /usr is not
|
||||
# up yet).
|
||||
[ -x /usr/sbin/rpc.idmapd ] || NEED_IDMAPD=no
|
||||
[ -x /usr/sbin/rpc.gssd ] || NEED_GSSD=no
|
||||
|
||||
if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]
|
||||
then
|
||||
do_modprobe sunrpc
|
||||
do_modprobe nfs
|
||||
do_modprobe nfsd
|
||||
mkdir -p "$PIPEFS_MOUNTPOINT"
|
||||
if do_mount rpc_pipefs $PIPEFS_MOUNTPOINT
|
||||
then
|
||||
if [ "$NEED_IDMAPD" = yes ]
|
||||
then
|
||||
log_progress_msg "idmapd"
|
||||
start-stop-daemon --start --oknodo --quiet \
|
||||
--exec /usr/sbin/rpc.idmapd
|
||||
RET=$?
|
||||
if [ $RET != 0 ]; then
|
||||
log_end_msg $RET
|
||||
exit $RET
|
||||
fi
|
||||
fi
|
||||
if [ "$NEED_GSSD" = yes ]
|
||||
then
|
||||
do_modprobe rpcsec_gss_krb5
|
||||
log_progress_msg "gssd"
|
||||
|
||||
# we need this available; better to fail now than
|
||||
# mysteriously on the first mount
|
||||
if ! grep -q -E '^nfs[ ]' /etc/services; then
|
||||
log_action_end_msg 1 "broken /etc/services, please see /usr/share/doc/nfs-common/README.Debian.nfsv4"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
start-stop-daemon --start --oknodo --quiet \
|
||||
--exec /usr/sbin/rpc.gssd -- $RPCGSSDOPTS
|
||||
RET=$?
|
||||
if [ $RET != 0 ]; then
|
||||
log_end_msg $RET
|
||||
exit $RET
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
log_end_msg 0
|
||||
;;
|
||||
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC"
|
||||
|
||||
if [ "$NEED_GSSD" = yes ]
|
||||
then
|
||||
log_progress_msg "gssd"
|
||||
start-stop-daemon --stop --oknodo --quiet \
|
||||
--name rpc.gssd
|
||||
RET=$?
|
||||
if [ $RET != 0 ]; then
|
||||
log_end_msg $RET
|
||||
exit $RET
|
||||
fi
|
||||
fi
|
||||
if [ "$NEED_IDMAPD" = yes ]
|
||||
then
|
||||
log_progress_msg "idmapd"
|
||||
start-stop-daemon --stop --oknodo --quiet \
|
||||
--name rpc.idmapd
|
||||
RET=$?
|
||||
if [ $RET != 0 ]; then
|
||||
log_end_msg $RET
|
||||
exit $RET
|
||||
fi
|
||||
fi
|
||||
if [ "$NEED_STATD" = yes ]
|
||||
then
|
||||
log_progress_msg "statd"
|
||||
start-stop-daemon --stop --oknodo --quiet \
|
||||
--name rpc.statd
|
||||
RET=$?
|
||||
if [ $RET != 0 ]; then
|
||||
log_end_msg $RET
|
||||
exit $RET
|
||||
fi
|
||||
fi
|
||||
do_umount $PIPEFS_MOUNTPOINT 2>/dev/null || true
|
||||
log_end_msg 0
|
||||
;;
|
||||
|
||||
status)
|
||||
if [ "$NEED_STATD" = yes ]
|
||||
then
|
||||
if ! pidof rpc.statd >/dev/null
|
||||
then
|
||||
echo "rpc.statd not running"
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$NEED_GSSD" = yes ]
|
||||
then
|
||||
if ! pidof rpc.gssd >/dev/null
|
||||
then
|
||||
echo "rpc.gssd not running"
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$NEED_IDMAPD" = yes ]
|
||||
then
|
||||
if ! pidof rpc.idmapd >/dev/null
|
||||
then
|
||||
echo "rpc.idmapd not running"
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "all daemons running"
|
||||
exit 0
|
||||
;;
|
||||
|
||||
restart | force-reload)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
|
||||
*)
|
||||
log_success_msg "Usage: nfs-common {start|stop|status|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+72
@@ -0,0 +1,72 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ntp
|
||||
# Required-Start: $network $remote_fs $syslog
|
||||
# Required-Stop: $network $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop:
|
||||
# Short-Description: Start NTP daemon
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
DAEMON=/usr/sbin/ntpd
|
||||
PIDFILE=/var/run/ntpd.pid
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
if [ -r /etc/default/ntp ]; then
|
||||
. /etc/default/ntp
|
||||
fi
|
||||
|
||||
if [ -e /run/ntp.conf.dhcp ]; then
|
||||
NTPD_OPTS="$NTPD_OPTS -c /run/ntp.conf.dhcp"
|
||||
fi
|
||||
|
||||
|
||||
RUNASUSER=ntp
|
||||
UGID=$(getent passwd $RUNASUSER | cut -f 3,4 -d:) || true
|
||||
if test "$(uname -s)" = "Linux"; then
|
||||
NTPD_OPTS="$NTPD_OPTS -u $UGID"
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
log_daemon_msg "Starting NTP server" "ntpd"
|
||||
if [ -z "$UGID" ]; then
|
||||
log_failure_msg "user \"$RUNASUSER\" does not exist"
|
||||
exit 1
|
||||
fi
|
||||
start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -p $PIDFILE $NTPD_OPTS
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping NTP server" "ntpd"
|
||||
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --retry=TERM/30/KILL/5 --exec $DAEMON
|
||||
log_end_msg $?
|
||||
rm -f $PIDFILE
|
||||
;;
|
||||
restart|force-reload)
|
||||
$0 stop && sleep 2 && $0 start
|
||||
;;
|
||||
try-restart)
|
||||
if $0 status >/dev/null; then
|
||||
$0 restart
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
reload)
|
||||
exit 3
|
||||
;;
|
||||
status)
|
||||
status_of_proc $DAEMON "NTP server"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
Executable
+89
@@ -0,0 +1,89 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: plymouth
|
||||
# Required-Start: udev $remote_fs $all
|
||||
# Required-Stop: $remote_fs
|
||||
# Should-Start: $x-display-manager
|
||||
# Should-Stop: $x-display-manager
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Stop plymouth during boot and start it on shutdown
|
||||
### END INIT INFO
|
||||
|
||||
PATH="/sbin:/bin:/usr/sbin:/usr/bin"
|
||||
NAME="plymouth"
|
||||
DESC="Boot splash manager"
|
||||
|
||||
test -x /usr/sbin/plymouthd || exit 0
|
||||
|
||||
if [ -r "/etc/default/${NAME}" ]
|
||||
then
|
||||
. "/etc/default/${NAME}"
|
||||
fi
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
set -e
|
||||
|
||||
SPLASH="true"
|
||||
for ARGUMENT in $(cat /proc/cmdline)
|
||||
do
|
||||
case "${ARGUMENT}" in
|
||||
splash*)
|
||||
SPLASH="true"
|
||||
;;
|
||||
|
||||
nosplash*|plymouth.enable=0)
|
||||
SPLASH="false"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
case "${1}" in
|
||||
start)
|
||||
case "${SPLASH}" in
|
||||
true)
|
||||
/usr/bin/plymouth quit --retain-splash
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
stop)
|
||||
case "${SPLASH}" in
|
||||
true)
|
||||
if ! plymouth --ping
|
||||
then
|
||||
/usr/sbin/plymouthd --mode=shutdown
|
||||
fi
|
||||
|
||||
RUNLEVEL="$(/sbin/runlevel | cut -d " " -f 2)"
|
||||
|
||||
case "${RUNLEVEL}" in
|
||||
0)
|
||||
TEXT="Shutting down system..."
|
||||
;;
|
||||
|
||||
6)
|
||||
TEXT="Restarting system..."
|
||||
;;
|
||||
esac
|
||||
|
||||
/usr/bin/plymouth message --text="${TEXT}"
|
||||
|
||||
/usr/bin/plymouth --show-splash
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
restart|force-reload)
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: ${0} {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: plymouth-log
|
||||
# Required-Start: $local_fs $remote_fs
|
||||
# Required-Stop: $local_fs $remote_fs
|
||||
# Should-Start:
|
||||
# Should-Stop:
|
||||
# Default-Start: S
|
||||
# Default-Stop:
|
||||
# Short-Description: Inform plymouth that /var/log is writable
|
||||
### END INIT INFO
|
||||
|
||||
PATH="/sbin:/bin:/usr/sbin:/usr/bin"
|
||||
NAME="plymouth-log"
|
||||
DESC="Boot splash manager (write log file)"
|
||||
|
||||
test -x /usr/bin/plymouth || exit 0
|
||||
|
||||
if [ -r "/etc/default/${NAME}" ]
|
||||
then
|
||||
. "/etc/default/${NAME}"
|
||||
fi
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
set -e
|
||||
|
||||
case "${1}" in
|
||||
start)
|
||||
if plymouth --ping
|
||||
then
|
||||
/usr/bin/plymouth update-root-fs --read-write
|
||||
fi
|
||||
;;
|
||||
|
||||
stop|restart|force-reload)
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: ${0} {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+136
@@ -0,0 +1,136 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
# Start or stop Postfix
|
||||
#
|
||||
# LaMont Jones <lamont@debian.org>
|
||||
# based on sendmail's init.d script
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: postfix mail-transport-agent
|
||||
# Required-Start: $local_fs $remote_fs $syslog $named $network $time
|
||||
# Required-Stop: $local_fs $remote_fs $syslog $named $network
|
||||
# Should-Start: postgresql mysql clamav-daemon postgrey spamassassin saslauthd dovecot
|
||||
# Should-Stop: postgresql mysql clamav-daemon postgrey spamassassin saslauthd dovecot
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Postfix Mail Transport Agent
|
||||
# Description: postfix is a Mail Transport agent
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||
DAEMON=/usr/sbin/postfix
|
||||
NAME=Postfix
|
||||
TZ=
|
||||
unset TZ
|
||||
|
||||
test -x $DAEMON && test -f /etc/postfix/main.cf || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
#DISTRO=$(lsb_release -is 2>/dev/null || echo Debian)
|
||||
|
||||
enabled_instances() {
|
||||
postmulti -l -a | awk '($3=="y") { print $1}'
|
||||
}
|
||||
|
||||
running() {
|
||||
INSTANCE="$1"
|
||||
if [ "X$INSTANCE" = X ]; then
|
||||
POSTMULTI=""
|
||||
else
|
||||
POSTMULTI="postmulti -i $INSTANCE -x "
|
||||
fi
|
||||
POSTCONF="${POSTMULTI} postconf"
|
||||
|
||||
daemon_directory=$($POSTCONF -hx daemon_directory 2>/dev/null || echo /usr/lib/postfix/sbin)
|
||||
if ! ${POSTMULTI} $daemon_directory/master -t 2>/dev/null ; then
|
||||
echo y
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting Postfix Mail Transport Agent" postfix
|
||||
RET=0
|
||||
# for all instances that are not already running, handle chroot setup if needed, and start
|
||||
for INSTANCE in $(enabled_instances); do
|
||||
RUNNING=$(running $INSTANCE)
|
||||
if [ "X$RUNNING" = X ]; then
|
||||
/usr/lib/postfix/configure-instance.sh $INSTANCE
|
||||
CMD="/usr/sbin/postmulti -- -i $INSTANCE -x ${DAEMON}"
|
||||
if ! start-stop-daemon --start --exec $CMD quiet-quick-start; then
|
||||
RET=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
log_end_msg $RET
|
||||
;;
|
||||
|
||||
stop)
|
||||
log_daemon_msg "Stopping Postfix Mail Transport Agent" postfix
|
||||
RET=0
|
||||
# for all instances that are not already running, handle chroot setup if needed, and start
|
||||
for INSTANCE in $(enabled_instances); do
|
||||
RUNNING=$(running $INSTANCE)
|
||||
if [ "X$RUNNING" != X ]; then
|
||||
CMD="/usr/sbin/postmulti -i $INSTANCE -x ${DAEMON}"
|
||||
if ! ${CMD} quiet-stop; then
|
||||
RET=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
log_end_msg $RET
|
||||
;;
|
||||
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
|
||||
force-reload|reload)
|
||||
log_action_begin_msg "Reloading Postfix configuration"
|
||||
if ${DAEMON} quiet-reload; then
|
||||
log_action_end_msg 0
|
||||
else
|
||||
log_action_end_msg 1
|
||||
fi
|
||||
;;
|
||||
|
||||
status)
|
||||
ALL=1
|
||||
ANY=0
|
||||
# for all instances that are not already running, handle chroot setup if needed, and start
|
||||
for INSTANCE in $(enabled_instances); do
|
||||
RUNNING=$(running $INSTANCE)
|
||||
if [ "X$RUNNING" != X ]; then
|
||||
ANY=1
|
||||
else
|
||||
ALL=0
|
||||
fi
|
||||
done
|
||||
# handle the case when postmulti returns *no* configured instances
|
||||
if [ $ANY = 0 ]; then
|
||||
ALL=0
|
||||
fi
|
||||
if [ $ALL = 1 ]; then
|
||||
log_success_msg "postfix is running"
|
||||
exit 0
|
||||
elif [ $ANY = 1 ]; then
|
||||
log_success_msg "some postfix instances are running"
|
||||
exit 0
|
||||
else
|
||||
log_success_msg "postfix is not running"
|
||||
exit 3
|
||||
fi
|
||||
;;
|
||||
|
||||
flush|check|abort)
|
||||
${DAEMON} $1
|
||||
;;
|
||||
|
||||
*)
|
||||
log_action_msg "Usage: /etc/init.d/postfix {start|stop|restart|reload|flush|check|abort|force-reload|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#! /bin/sh
|
||||
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
|
||||
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
|
||||
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
|
||||
fi
|
||||
### BEGIN INIT INFO
|
||||
# Provides: procps
|
||||
# Required-Start: mountkernfs $local_fs
|
||||
# Required-Stop:
|
||||
# Should-Start: udev module-init-tools
|
||||
# X-Start-Before: $network
|
||||
# Default-Start: S
|
||||
# Default-Stop:
|
||||
# Short-Description: Configure kernel parameters at boottime
|
||||
# Description: Loads kernel parameters that are specified in /etc/sysctl.conf
|
||||
### END INIT INFO
|
||||
#
|
||||
# written by Elrond <Elrond@Wunder-Nett.org>
|
||||
|
||||
DESC="Setting kernel variables"
|
||||
DAEMON=/sbin/sysctl
|
||||
PIDFILE=none
|
||||
|
||||
# Comment this out for sysctl to print every item changed
|
||||
QUIET_SYSCTL="-q"
|
||||
|
||||
do_start_cmd() {
|
||||
STATUS=0
|
||||
$DAEMON $QUIET_SYSCTL --system || STATUS=$?
|
||||
return $STATUS
|
||||
}
|
||||
|
||||
do_stop() { return 0; }
|
||||
do_status() { return 0; }
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: pulseaudio-enable-autospawn
|
||||
# Required-Start: $local_fs
|
||||
# Required-Stop: umountfs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Enable pulseaudio autospawn
|
||||
# Description: Enables autospawn for the pulseaudio daemon
|
||||
### END INIT INFO
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
|
||||
case "$1" in
|
||||
start|reload|restart|force-reload)
|
||||
echo "autospawn=yes" > /run/pulseaudio-enable-autospawn
|
||||
;;
|
||||
stop|status)
|
||||
;;
|
||||
esac
|
||||
Executable
+101
@@ -0,0 +1,101 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# start/stop rpcbind daemon.
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: rpcbind portmap
|
||||
# Required-Start: $network $local_fs
|
||||
# Required-Stop: $network $local_fs
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: RPC portmapper replacement
|
||||
# Description: rpcbind is a server that converts RPC (Remote
|
||||
# Procedure Call) program numbers into DARPA
|
||||
# protocol port numbers. It must be running in
|
||||
# order to make RPC calls. Services that use
|
||||
# RPC include NFS and NIS.
|
||||
### END INIT INFO
|
||||
|
||||
test -f /sbin/rpcbind || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
OPTIONS="-w"
|
||||
STATEDIR=/run/rpcbind
|
||||
PIDFILE=/run/rpcbind.pid
|
||||
|
||||
if [ -f /etc/default/rpcbind ]
|
||||
then
|
||||
. /etc/default/rpcbind
|
||||
elif [ -f /etc/rpcbind.conf ]
|
||||
then
|
||||
. /etc/rpcbind.conf
|
||||
fi
|
||||
|
||||
start ()
|
||||
{
|
||||
if [ ! -d $STATEDIR ] ; then
|
||||
mkdir $STATEDIR
|
||||
chown _rpc:root $STATEDIR
|
||||
chmod 0755 $STATEDIR
|
||||
fi
|
||||
if [ `ls -dl "$STATEDIR" | grep -cE '^drwxr-xr-x [0-9]+ _rpc root '` -lt 1 ] ; then
|
||||
log_begin_msg "$STATEDIR not owned by root"
|
||||
log_end_msg 1
|
||||
exit 1
|
||||
fi
|
||||
[ -x /sbin/restorecon ] && /sbin/restorecon $STATEDIR
|
||||
pid=$( pidofproc /sbin/rpcbind )
|
||||
if [ -n "$pid" ]
|
||||
then
|
||||
log_action_msg "Already running: rpcbind"
|
||||
exit 0
|
||||
fi
|
||||
log_daemon_msg "Starting RPC port mapper daemon" "rpcbind"
|
||||
start-stop-daemon --start --quiet --oknodo --exec /sbin/rpcbind -- "$@"
|
||||
pid=$( pidofproc /sbin/rpcbind )
|
||||
echo -n "$pid" >"$PIDFILE"
|
||||
# /run/sendsigs.omit.d is created by /etc/init.d/mountkernfs.sh
|
||||
ln -sf "$PIDFILE" /run/sendsigs.omit.d/rpcbind
|
||||
log_end_msg $?
|
||||
|
||||
}
|
||||
|
||||
stop ()
|
||||
{
|
||||
log_daemon_msg "Stopping RPC port mapper daemon" "rpcbind"
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --oknodo --exec /sbin/rpcbind
|
||||
rm -f "$PIDFILE"
|
||||
log_end_msg $?
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if init_is_upstart; then
|
||||
exit 1
|
||||
fi
|
||||
start $OPTIONS
|
||||
;;
|
||||
stop)
|
||||
if init_is_upstart; then
|
||||
exit 0
|
||||
fi
|
||||
stop
|
||||
;;
|
||||
restart|force-reload)
|
||||
if init_is_upstart; then
|
||||
exit 1
|
||||
fi
|
||||
stop
|
||||
start $OPTIONS
|
||||
;;
|
||||
status)
|
||||
status_of_proc /sbin/rpcbind rpcbind && exit 0 || exit $?
|
||||
;;
|
||||
*)
|
||||
log_success_msg "Usage: /etc/init.d/rpcbind {start|stop|force-reload|restart|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+156
@@ -0,0 +1,156 @@
|
||||
#! /bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: rsyncd
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs $syslog
|
||||
# Should-Start: $named autofs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop:
|
||||
# Short-Description: fast remote file copy program daemon
|
||||
# Description: rsync is a program that allows files to be copied to and
|
||||
# from remote machines in much the same way as rcp.
|
||||
# This provides rsyncd daemon functionality.
|
||||
### END INIT INFO
|
||||
|
||||
set -e
|
||||
|
||||
# /etc/init.d/rsync: start and stop the rsync daemon
|
||||
|
||||
DAEMON=/usr/bin/rsync
|
||||
RSYNC_ENABLE=false
|
||||
RSYNC_OPTS=''
|
||||
RSYNC_DEFAULTS_FILE=/etc/default/rsync
|
||||
RSYNC_CONFIG_FILE=/etc/rsyncd.conf
|
||||
RSYNC_PID_FILE=/var/run/rsync.pid
|
||||
RSYNC_NICE_PARM=''
|
||||
RSYNC_IONICE_PARM=''
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
if [ -s $RSYNC_DEFAULTS_FILE ]; then
|
||||
. $RSYNC_DEFAULTS_FILE
|
||||
case "x$RSYNC_ENABLE" in
|
||||
xtrue|xfalse) ;;
|
||||
xinetd) exit 0
|
||||
;;
|
||||
*) log_failure_msg "Value of RSYNC_ENABLE in $RSYNC_DEFAULTS_FILE must be either 'true' or 'false';"
|
||||
log_failure_msg "not starting rsync daemon."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
case "x$RSYNC_NICE" in
|
||||
x[0-9]|x1[0-9]) RSYNC_NICE_PARM="--nicelevel $RSYNC_NICE";;
|
||||
x) ;;
|
||||
*) log_warning_msg "Value of RSYNC_NICE in $RSYNC_DEFAULTS_FILE must be a value between 0 and 19 (inclusive);"
|
||||
log_warning_msg "ignoring RSYNC_NICE now."
|
||||
;;
|
||||
esac
|
||||
case "x$RSYNC_IONICE" in
|
||||
x-c[123]*) RSYNC_IONICE_PARM="$RSYNC_IONICE";;
|
||||
x) ;;
|
||||
*) log_warning_msg "Value of RSYNC_IONICE in $RSYNC_DEFAULTS_FILE must be -c1, -c2 or -c3;"
|
||||
log_warning_msg "ignoring RSYNC_IONICE now."
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
|
||||
|
||||
rsync_start() {
|
||||
if [ ! -s "$RSYNC_CONFIG_FILE" ]; then
|
||||
log_failure_msg "missing or empty config file $RSYNC_CONFIG_FILE"
|
||||
log_end_msg 1
|
||||
exit 0
|
||||
fi
|
||||
# See ionice(1)
|
||||
if [ -n "$RSYNC_IONICE_PARM" ] && [ -x /usr/bin/ionice ] &&
|
||||
/usr/bin/ionice "$RSYNC_IONICE_PARM" true 2>/dev/null; then
|
||||
/usr/bin/ionice "$RSYNC_IONICE_PARM" -p$$ > /dev/null 2>&1
|
||||
fi
|
||||
if start-stop-daemon --start --quiet --background \
|
||||
--pidfile $RSYNC_PID_FILE --make-pidfile \
|
||||
$RSYNC_NICE_PARM --exec $DAEMON \
|
||||
-- --no-detach --daemon --config "$RSYNC_CONFIG_FILE" $RSYNC_OPTS
|
||||
then
|
||||
rc=0
|
||||
sleep 1
|
||||
if ! kill -0 $(cat $RSYNC_PID_FILE) >/dev/null 2>&1; then
|
||||
log_failure_msg "rsync daemon failed to start"
|
||||
rc=1
|
||||
fi
|
||||
else
|
||||
rc=1
|
||||
fi
|
||||
if [ $rc -eq 0 ]; then
|
||||
log_end_msg 0
|
||||
else
|
||||
log_end_msg 1
|
||||
rm -f $RSYNC_PID_FILE
|
||||
fi
|
||||
} # rsync_start
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if "$RSYNC_ENABLE"; then
|
||||
log_daemon_msg "Starting rsync daemon" "rsync"
|
||||
if [ -s $RSYNC_PID_FILE ] && kill -0 $(cat $RSYNC_PID_FILE) >/dev/null 2>&1; then
|
||||
log_progress_msg "apparently already running"
|
||||
log_end_msg 0
|
||||
exit 0
|
||||
fi
|
||||
rsync_start
|
||||
else
|
||||
if [ -s "$RSYNC_CONFIG_FILE" ]; then
|
||||
[ "$VERBOSE" != no ] && log_warning_msg "rsync daemon not enabled in $RSYNC_DEFAULTS_FILE, not starting..."
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping rsync daemon" "rsync"
|
||||
start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $RSYNC_PID_FILE
|
||||
RETVAL="$?"
|
||||
log_end_msg $RETVAL
|
||||
if [ $RETVAL != 0 ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
rm -f $RSYNC_PID_FILE
|
||||
;;
|
||||
|
||||
reload|force-reload)
|
||||
log_warning_msg "Reloading rsync daemon: not needed, as the daemon"
|
||||
log_warning_msg "re-reads the config file whenever a client connects."
|
||||
;;
|
||||
|
||||
restart)
|
||||
set +e
|
||||
if $RSYNC_ENABLE; then
|
||||
log_daemon_msg "Restarting rsync daemon" "rsync"
|
||||
if [ -s $RSYNC_PID_FILE ] && kill -0 $(cat $RSYNC_PID_FILE) >/dev/null 2>&1; then
|
||||
start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $RSYNC_PID_FILE
|
||||
else
|
||||
log_warning_msg "rsync daemon not running, attempting to start."
|
||||
rm -f $RSYNC_PID_FILE
|
||||
fi
|
||||
rsync_start
|
||||
else
|
||||
if [ -s "$RSYNC_CONFIG_FILE" ]; then
|
||||
[ "$VERBOSE" != no ] && log_warning_msg "rsync daemon not enabled in $RSYNC_DEFAULTS_FILE, not starting..."
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
status)
|
||||
status_of_proc -p $RSYNC_PID_FILE "$DAEMON" rsync
|
||||
exit $? # notreached due to set -e
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/rsync {start|stop|reload|force-reload|restart|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+129
@@ -0,0 +1,129 @@
|
||||
#! /bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: rsyslog
|
||||
# Required-Start: $remote_fs $time
|
||||
# Required-Stop: umountnfs $time
|
||||
# X-Stop-After: sendsigs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: enhanced syslogd
|
||||
# Description: Rsyslog is an enhanced multi-threaded syslogd.
|
||||
# It is quite compatible to stock sysklogd and can be
|
||||
# used as a drop-in replacement.
|
||||
### END INIT INFO
|
||||
|
||||
#
|
||||
# Author: Michael Biebl <biebl@debian.org>
|
||||
#
|
||||
|
||||
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
DESC="enhanced syslogd"
|
||||
NAME=rsyslog
|
||||
|
||||
RSYSLOGD=rsyslogd
|
||||
DAEMON=/usr/sbin/rsyslogd
|
||||
PIDFILE=/run/rsyslogd.pid
|
||||
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x "$DAEMON" ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
# Define LSB log_* functions.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
do_start()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# other if daemon could not be started or a failure occured
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $RSYSLOGD_OPTIONS
|
||||
}
|
||||
|
||||
do_stop()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been stopped
|
||||
# 1 if daemon was already stopped
|
||||
# other if daemon could not be stopped or a failure occurred
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --exec $DAEMON
|
||||
}
|
||||
|
||||
#
|
||||
# Tell rsyslogd to close all open files
|
||||
#
|
||||
do_rotate() {
|
||||
start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE --exec $DAEMON
|
||||
}
|
||||
|
||||
create_xconsole() {
|
||||
XCONSOLE=/dev/xconsole
|
||||
if [ "$(uname -s)" != "Linux" ]; then
|
||||
XCONSOLE=/run/xconsole
|
||||
ln -sf $XCONSOLE /dev/xconsole
|
||||
fi
|
||||
if [ ! -e $XCONSOLE ]; then
|
||||
mknod -m 640 $XCONSOLE p
|
||||
chown root:adm $XCONSOLE
|
||||
[ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE
|
||||
fi
|
||||
}
|
||||
|
||||
sendsigs_omit() {
|
||||
OMITDIR=/run/sendsigs.omit.d
|
||||
mkdir -p $OMITDIR
|
||||
ln -sf $PIDFILE $OMITDIR/rsyslog
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting $DESC" "$RSYSLOGD"
|
||||
create_xconsole
|
||||
do_start
|
||||
case "$?" in
|
||||
0) sendsigs_omit
|
||||
log_end_msg 0 ;;
|
||||
1) log_progress_msg "already started"
|
||||
log_end_msg 0 ;;
|
||||
*) log_end_msg 1 ;;
|
||||
esac
|
||||
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC" "$RSYSLOGD"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_progress_msg "already stopped"
|
||||
log_end_msg 0 ;;
|
||||
*) log_end_msg 1 ;;
|
||||
esac
|
||||
|
||||
;;
|
||||
rotate)
|
||||
log_daemon_msg "Closing open files" "$RSYSLOGD"
|
||||
do_rotate
|
||||
log_end_msg $?
|
||||
;;
|
||||
restart|force-reload)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
try-restart)
|
||||
$0 status >/dev/null 2>&1 && $0 restart
|
||||
;;
|
||||
status)
|
||||
status_of_proc -p $PIDFILE $DAEMON $RSYSLOGD && exit 0 || exit $?
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|rotate|restart|force-reload|try-restart|status}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
:
|
||||
Executable
+90
@@ -0,0 +1,90 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: saned
|
||||
# Required-Start: $syslog $local_fs $remote_fs
|
||||
# Required-Stop: $syslog $local_fs $remote_fs
|
||||
# Should-Start: dbus avahi-daemon
|
||||
# Should-Stop: dbus avahi-daemon
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: SANE network scanner server
|
||||
# Description: saned makes local scanners available over the
|
||||
# network.
|
||||
### END INIT INFO
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DAEMON=/usr/sbin/saned
|
||||
NAME=saned
|
||||
DESC="SANE network scanner server"
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
RUN=no
|
||||
RUN_AS_USER=saned
|
||||
|
||||
# Get lsb functions
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
# Include saned defaults if available
|
||||
if [ -f /etc/default/saned ] ; then
|
||||
. /etc/default/saned
|
||||
fi
|
||||
|
||||
DAEMON_OPTS="-a $RUN_AS_USER"
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting $DESC" "$NAME"
|
||||
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
|
||||
--exec $DAEMON -- $DAEMON_OPTS
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
start-stop-daemon --stop --oknodo --quiet --pidfile /var/run/$NAME.pid \
|
||||
--retry 10 --exec $DAEMON
|
||||
log_end_msg $?
|
||||
;;
|
||||
force-reload)
|
||||
# check whether $DAEMON is running. If so, restart
|
||||
start-stop-daemon --stop --test --quiet --pidfile \
|
||||
/var/run/$NAME.pid --exec $DAEMON \
|
||||
&& $0 restart \
|
||||
|| exit 0
|
||||
;;
|
||||
restart)
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
status)
|
||||
if [ -s /var/run/$NAME.pid ]; then
|
||||
RUNNING=$(cat /var/run/$NAME.pid)
|
||||
if [ -d /proc/$RUNNING ]; then
|
||||
if [ $(readlink /proc/$RUNNING/exe) = $DAEMON ]; then
|
||||
log_success_msg "$NAME is running"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# No such PID, or executables don't match
|
||||
log_failure_msg "$NAME is not running, but pidfile existed"
|
||||
rm /var/run/$NAME.pid
|
||||
exit 1
|
||||
else
|
||||
rm -f /var/run/$NAME.pid
|
||||
log_failure_msg "$NAME not running"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/$NAME
|
||||
log_failure_msg "Usage: $N {start|stop|restart|force-reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
# $Id: init,v 1.3 2004/03/16 01:43:45 zal Exp $
|
||||
#
|
||||
# Script to remove stale screen named pipes on bootup.
|
||||
#
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: screen-cleanup
|
||||
# Required-Start: $remote_fs
|
||||
# Required-Stop: $remote_fs
|
||||
# Default-Start: S
|
||||
# Default-Stop:
|
||||
# Short-Description: screen sessions cleaning
|
||||
# Description: Cleans up the screen session directory and fixes its
|
||||
# permissions if needed.
|
||||
### END INIT INFO
|
||||
|
||||
set -e
|
||||
|
||||
test -f /usr/bin/screen || exit 0
|
||||
|
||||
SCREENDIR=/run/screen
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if test -L $SCREENDIR || ! test -d $SCREENDIR; then
|
||||
rm -f $SCREENDIR
|
||||
mkdir $SCREENDIR
|
||||
chown root:utmp $SCREENDIR
|
||||
[ -x /sbin/restorecon ] && /sbin/restorecon $SCREENDIR
|
||||
fi
|
||||
find $SCREENDIR -type p -delete
|
||||
# If the local admin has used dpkg-statoverride to install the screen
|
||||
# binary with different set[ug]id bits, change the permissions of
|
||||
# $SCREENDIR accordingly
|
||||
BINARYPERM=`stat -c%a /usr/bin/screen`
|
||||
if [ "$BINARYPERM" -ge 4000 ]; then
|
||||
chmod 0755 $SCREENDIR
|
||||
elif [ "$BINARYPERM" -ge 2000 ]; then
|
||||
chmod 0775 $SCREENDIR
|
||||
else
|
||||
chmod 1777 $SCREENDIR
|
||||
fi
|
||||
;;
|
||||
stop|restart|reload|force-reload)
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+79
@@ -0,0 +1,79 @@
|
||||
#! /bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: speech-dispatcher
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs $syslog
|
||||
# Should-Start: festival
|
||||
# Should-Stop: festival
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Speech Dispatcher
|
||||
# Description: Common interface to speech synthesizers
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DAEMON=/usr/bin/speech-dispatcher
|
||||
PIDFILE=/run/speech-dispatcher/speech-dispatcher.pid
|
||||
NAME=speech-dispatcher
|
||||
DESC='Speech Dispatcher'
|
||||
USER=speech-dispatcher
|
||||
|
||||
test -f $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
set -e
|
||||
|
||||
do_start () {
|
||||
PIDDIR=`dirname $PIDFILE`
|
||||
[ -e $PIDDIR ] || install -d -ospeech-dispatcher -gaudio -m750 $PIDDIR
|
||||
SDDIR=$PIDDIR/.speech-dispatcher
|
||||
[ -e $SDDIR ] || ln -s $PIDDIR $SDDIR
|
||||
LOGDIR=$SDDIR/log
|
||||
[ -e $LOGDIR ] || ln -s /var/log/speech-dispatcher $LOGDIR
|
||||
CACHEDIR=$SDDIR/.cache
|
||||
[ -e $CACHEDIR ] || install -d -ospeech-dispatcher -gaudio -m750 $CACHEDIR
|
||||
CACHEDIR2=$CACHEDIR/speech-dispatcher
|
||||
[ -e $CACHEDIR2 ] || ln -s $SSDIR $CACHEDIR2
|
||||
start-stop-daemon --oknodo --start --quiet --chuid $USER --pidfile $PIDFILE \
|
||||
--exec $DAEMON -- --pid-file $PIDFILE
|
||||
}
|
||||
|
||||
do_stop () {
|
||||
start-stop-daemon --oknodo --stop --quiet --user $USER \
|
||||
--pidfile $PIDFILE --exec $DAEMON
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting $DESC" "speech-dispatcher"
|
||||
do_start
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC" "speech-dispatcher"
|
||||
do_stop
|
||||
log_end_msg $?
|
||||
;;
|
||||
reload|force-reload)
|
||||
log_daemon_msg "Reloading $DESC configuration files" "speech-dispatcher"
|
||||
start-stop-daemon --oknodo --stop --signal 1 --quiet --user $USER \
|
||||
--pidfile $PIDFILE --exec $DAEMON
|
||||
log_end_msg $?
|
||||
;;
|
||||
restart)
|
||||
log_daemon_msg "Restarting $DESC" "speech-dispatcher"
|
||||
do_stop
|
||||
sleep 3
|
||||
do_start
|
||||
log_end_msg $?
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/$NAME
|
||||
echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+166
@@ -0,0 +1,166 @@
|
||||
#! /bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: sshd
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop:
|
||||
# Short-Description: OpenBSD Secure Shell server
|
||||
### END INIT INFO
|
||||
|
||||
set -e
|
||||
|
||||
# /etc/init.d/ssh: start and stop the OpenBSD "secure shell(tm)" daemon
|
||||
|
||||
test -x /usr/sbin/sshd || exit 0
|
||||
( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0
|
||||
|
||||
umask 022
|
||||
|
||||
if test -f /etc/default/ssh; then
|
||||
. /etc/default/ssh
|
||||
fi
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
if [ -n "$2" ]; then
|
||||
SSHD_OPTS="$SSHD_OPTS $2"
|
||||
fi
|
||||
|
||||
# Are we running from init?
|
||||
run_by_init() {
|
||||
([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
|
||||
}
|
||||
|
||||
check_for_no_start() {
|
||||
# forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists
|
||||
if [ -e /etc/ssh/sshd_not_to_be_run ]; then
|
||||
if [ "$1" = log_end_msg ]; then
|
||||
log_end_msg 0 || true
|
||||
fi
|
||||
if ! run_by_init; then
|
||||
log_action_msg "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" || true
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
check_dev_null() {
|
||||
if [ ! -c /dev/null ]; then
|
||||
if [ "$1" = log_end_msg ]; then
|
||||
log_end_msg 1 || true
|
||||
fi
|
||||
if ! run_by_init; then
|
||||
log_action_msg "/dev/null is not a character device!" || true
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_privsep_dir() {
|
||||
# Create the PrivSep empty dir if necessary
|
||||
if [ ! -d /run/sshd ]; then
|
||||
mkdir /run/sshd
|
||||
chmod 0755 /run/sshd
|
||||
fi
|
||||
}
|
||||
|
||||
check_config() {
|
||||
if [ ! -e /etc/ssh/sshd_not_to_be_run ]; then
|
||||
# shellcheck disable=SC2086
|
||||
/usr/sbin/sshd $SSHD_OPTS -t || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
check_privsep_dir
|
||||
check_for_no_start
|
||||
check_dev_null
|
||||
log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd" || true
|
||||
# shellcheck disable=SC2086
|
||||
if start-stop-daemon --start --quiet --oknodo --chuid 0:0 --pidfile /run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
|
||||
log_end_msg 0 || true
|
||||
else
|
||||
log_end_msg 1 || true
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd" || true
|
||||
if start-stop-daemon --stop --quiet --oknodo --pidfile /run/sshd.pid --exec /usr/sbin/sshd; then
|
||||
log_end_msg 0 || true
|
||||
else
|
||||
log_end_msg 1 || true
|
||||
fi
|
||||
;;
|
||||
|
||||
reload|force-reload)
|
||||
check_for_no_start
|
||||
check_config
|
||||
log_daemon_msg "Reloading OpenBSD Secure Shell server's configuration" "sshd" || true
|
||||
if start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /run/sshd.pid --exec /usr/sbin/sshd; then
|
||||
log_end_msg 0 || true
|
||||
else
|
||||
log_end_msg 1 || true
|
||||
fi
|
||||
;;
|
||||
|
||||
restart)
|
||||
check_privsep_dir
|
||||
check_config
|
||||
log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" || true
|
||||
start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /run/sshd.pid --exec /usr/sbin/sshd
|
||||
check_for_no_start log_end_msg
|
||||
check_dev_null log_end_msg
|
||||
# shellcheck disable=SC2086
|
||||
if start-stop-daemon --start --quiet --oknodo --chuid 0:0 --pidfile /run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
|
||||
log_end_msg 0 || true
|
||||
else
|
||||
log_end_msg 1 || true
|
||||
fi
|
||||
;;
|
||||
|
||||
try-restart)
|
||||
check_privsep_dir
|
||||
check_config
|
||||
log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" || true
|
||||
RET=0
|
||||
start-stop-daemon --stop --quiet --retry 30 --pidfile /run/sshd.pid --exec /usr/sbin/sshd || RET="$?"
|
||||
case $RET in
|
||||
0)
|
||||
# old daemon stopped
|
||||
check_for_no_start log_end_msg
|
||||
check_dev_null log_end_msg
|
||||
# shellcheck disable=SC2086
|
||||
if start-stop-daemon --start --quiet --oknodo --chuid 0:0 --pidfile /run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
|
||||
log_end_msg 0 || true
|
||||
else
|
||||
log_end_msg 1 || true
|
||||
fi
|
||||
;;
|
||||
1)
|
||||
# daemon not running
|
||||
log_progress_msg "(not running)" || true
|
||||
log_end_msg 0 || true
|
||||
;;
|
||||
*)
|
||||
# failed to stop
|
||||
log_progress_msg "(failed to stop)" || true
|
||||
log_end_msg 1 || true
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
status)
|
||||
status_of_proc -p /run/sshd.pid /usr/sbin/sshd sshd && exit 0 || exit $?
|
||||
;;
|
||||
|
||||
*)
|
||||
log_action_msg "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart|try-restart|status}" || true
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#! /bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: sudo
|
||||
# Required-Start: $local_fs $remote_fs
|
||||
# Required-Stop:
|
||||
# X-Start-Before: rmnologin
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop:
|
||||
# Short-Description: Provide limited super user privileges to specific users
|
||||
# Description: Provide limited super user privileges to specific users.
|
||||
### END INIT INFO
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
N=/etc/init.d/sudo
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
# make sure privileges don't persist across reboots
|
||||
# if the /run/sudo directory doesn't exist, let's create it with the
|
||||
# correct permissions and SELinux label
|
||||
if [ -d /run/sudo ]
|
||||
then
|
||||
find /run/sudo -exec touch -d @0 '{}' \;
|
||||
else
|
||||
mkdir /run/sudo /run/sudo/ts
|
||||
chown root:root /run/sudo /run/sudo/ts
|
||||
chmod 0711 /run/sudo
|
||||
chmod 0700 /run/sudo/ts
|
||||
[ -x /sbin/restorecon ] && /sbin/restorecon /run/sudo /run/sudo/ts
|
||||
fi
|
||||
;;
|
||||
stop|reload|restart|force-reload|status)
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# /etc/init.d/systune
|
||||
# update-rc.d systune start 50 2 3 4 5 .
|
||||
|
||||
[ -f /etc/default/rcS ] && . /etc/default/rcS
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
PACKAGE="systune"
|
||||
SOURCE="systune"
|
||||
|
||||
set -e
|
||||
### BEGIN INIT INFO
|
||||
# Provides: systune
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop:
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
PROGRAM=/usr/sbin/systune
|
||||
NAME=systune
|
||||
DESC="tuning kernel"
|
||||
|
||||
test -f $PROGRAM || exit 0
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Configuring kernel parameters..."
|
||||
$PROGRAM
|
||||
echo " done"
|
||||
;;
|
||||
stop)
|
||||
;;
|
||||
reload|restart|force-reload)
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/$NAME
|
||||
echo "Usage: $N {start|stop|reload|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+255
@@ -0,0 +1,255 @@
|
||||
#!/bin/sh -e
|
||||
### BEGIN INIT INFO
|
||||
# Provides: udev
|
||||
# Required-Start: mountkernfs
|
||||
# Required-Stop: umountroot
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Start systemd-udevd, populate /dev and load drivers.
|
||||
### END INIT INFO
|
||||
|
||||
PATH="/sbin:/bin"
|
||||
NAME="systemd-udevd"
|
||||
DAEMON="/lib/systemd/systemd-udevd"
|
||||
DESC="hotplug events dispatcher"
|
||||
PIDFILE="/run/udev.pid"
|
||||
CTRLFILE="/run/udev/control"
|
||||
OMITDIR="/run/sendsigs.omit.d"
|
||||
|
||||
# we need to unmount /dev/pts/ and remount it later over the devtmpfs
|
||||
unmount_devpts() {
|
||||
if mountpoint -q /dev/pts/; then
|
||||
umount -n -l /dev/pts/
|
||||
fi
|
||||
|
||||
if mountpoint -q /dev/shm/; then
|
||||
umount -n -l /dev/shm/
|
||||
fi
|
||||
}
|
||||
|
||||
# mount a devtmpfs over /dev, if somebody did not already do it
|
||||
mount_devtmpfs() {
|
||||
if grep -E -q "^[^[:space:]]+ /dev devtmpfs" /proc/mounts; then
|
||||
mount -n -o remount,nosuid,size=$tmpfs_size,mode=0755 -t devtmpfs devtmpfs /dev
|
||||
return
|
||||
fi
|
||||
|
||||
if ! mount -n -o nosuid,size=$tmpfs_size,mode=0755 -t devtmpfs devtmpfs /dev; then
|
||||
log_failure_msg "udev requires devtmpfs support, not started"
|
||||
log_end_msg 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
create_dev_makedev() {
|
||||
if [ -e /sbin/MAKEDEV ]; then
|
||||
ln -sf /sbin/MAKEDEV /dev/MAKEDEV
|
||||
else
|
||||
ln -sf /bin/true /dev/MAKEDEV
|
||||
fi
|
||||
}
|
||||
|
||||
# shell version of /usr/bin/tty
|
||||
my_tty() {
|
||||
[ -x /bin/readlink ] || return 0
|
||||
[ -e /proc/self/fd/0 ] || return 0
|
||||
readlink --silent /proc/self/fd/0 || true
|
||||
}
|
||||
|
||||
warn_if_interactive() {
|
||||
if [ "$RUNLEVEL" = "S" -a "$PREVLEVEL" = "N" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
TTY=$(my_tty)
|
||||
if [ -z "$TTY" -o "$TTY" = "/dev/console" -o "$TTY" = "/dev/null" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
printf "\n\n\nIt has been detected that the command\n\n\t$0 $*\n\n"
|
||||
printf "has been run from an interactive shell.\n"
|
||||
printf "It will probably not do what you expect, so this script will wait\n"
|
||||
printf "60 seconds before continuing. Press ^C to stop it.\n"
|
||||
printf "RUNNING THIS COMMAND IS HIGHLY DISCOURAGED!\n\n\n\n"
|
||||
sleep 60
|
||||
}
|
||||
|
||||
make_static_nodes() {
|
||||
[ -e /lib/modules/$(uname -r)/modules.devname ] || return 0
|
||||
[ -x /bin/kmod ] || return 0
|
||||
|
||||
/bin/kmod static-nodes --format=tmpfiles --output=/proc/self/fd/1 | \
|
||||
while read type name mode uid gid age arg; do
|
||||
[ -e $name ] && continue
|
||||
case "$type" in
|
||||
c|b|c!|b!) mknod -m $mode $name $type $(echo $arg | sed 's/:/ /') ;;
|
||||
d|d!) mkdir $name ;;
|
||||
*) echo "unparseable line ($type $name $mode $uid $gid $age $arg)" >&2 ;;
|
||||
esac
|
||||
|
||||
if [ -x /sbin/restorecon ]; then
|
||||
/sbin/restorecon $name
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
##############################################################################
|
||||
|
||||
|
||||
[ -x $DAEMON ] || exit 0
|
||||
|
||||
# defaults
|
||||
tmpfs_size="10M"
|
||||
|
||||
if [ -e /etc/udev/udev.conf ]; then
|
||||
. /etc/udev/udev.conf
|
||||
fi
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
if [ ! -e /proc/filesystems ]; then
|
||||
log_failure_msg "udev requires a mounted procfs, not started"
|
||||
log_end_msg 1
|
||||
fi
|
||||
|
||||
if ! grep -q '[[:space:]]devtmpfs$' /proc/filesystems; then
|
||||
log_failure_msg "udev requires devtmpfs support, not started"
|
||||
log_end_msg 1
|
||||
fi
|
||||
|
||||
if [ ! -d /sys/class/ ]; then
|
||||
log_failure_msg "udev requires a mounted sysfs, not started"
|
||||
log_end_msg 1
|
||||
fi
|
||||
|
||||
if [ ! -w /sys ]; then
|
||||
log_warning_msg "udev does not support containers, not started"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -d /sys/class/mem/null -a ! -L /sys/class/mem/null ] || \
|
||||
[ -e /sys/block -a ! -e /sys/class/block ]; then
|
||||
log_warning_msg "CONFIG_SYSFS_DEPRECATED must not be selected"
|
||||
log_warning_msg "Booting will continue in 30 seconds but many things will be broken"
|
||||
sleep 30
|
||||
fi
|
||||
|
||||
# When modifying this script, do not forget that between the time that the
|
||||
# new /dev has been mounted and udevadm trigger has been run there will be
|
||||
# no /dev/null. This also means that you cannot use the "&" shell command.
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if [ ! -e "/run/udev/" ]; then
|
||||
warn_if_interactive
|
||||
fi
|
||||
|
||||
if [ -w /sys/kernel/uevent_helper ]; then
|
||||
echo > /sys/kernel/uevent_helper
|
||||
fi
|
||||
|
||||
if ! mountpoint -q /dev/; then
|
||||
unmount_devpts
|
||||
mount_devtmpfs
|
||||
[ -d /proc/1 ] || mount -n /proc
|
||||
fi
|
||||
|
||||
make_static_nodes
|
||||
|
||||
# clean up parts of the database created by the initramfs udev
|
||||
udevadm info --cleanup-db
|
||||
|
||||
# set the SELinux context for devices created in the initramfs
|
||||
[ -x /sbin/restorecon ] && /sbin/restorecon -R /dev
|
||||
|
||||
log_daemon_msg "Starting $DESC" "$NAME"
|
||||
if start-stop-daemon --start --name $NAME --user root --quiet \
|
||||
--pidfile $PIDFILE --exec $DAEMON --background --make-pidfile \
|
||||
--notify-await; then
|
||||
# prevents udevd to be killed by sendsigs (see #791944)
|
||||
mkdir -p $OMITDIR
|
||||
ln -sf $PIDFILE $OMITDIR/$NAME
|
||||
log_end_msg $?
|
||||
else
|
||||
log_warning_msg $?
|
||||
log_warning_msg "Waiting 15 seconds and trying to continue anyway"
|
||||
sleep 15
|
||||
fi
|
||||
|
||||
log_action_begin_msg "Synthesizing the initial hotplug events (subsystems)"
|
||||
if udevadm trigger --type=subsystems --action=add; then
|
||||
log_action_end_msg $?
|
||||
else
|
||||
log_action_end_msg $?
|
||||
fi
|
||||
log_action_begin_msg "Synthesizing the initial hotplug events (devices)"
|
||||
if udevadm trigger --type=devices --action=add; then
|
||||
log_action_end_msg $?
|
||||
else
|
||||
log_action_end_msg $?
|
||||
fi
|
||||
|
||||
create_dev_makedev
|
||||
|
||||
# wait for the systemd-udevd childs to finish
|
||||
log_action_begin_msg "Waiting for /dev to be fully populated"
|
||||
if udevadm settle; then
|
||||
log_action_end_msg 0
|
||||
else
|
||||
log_action_end_msg 0 'timeout'
|
||||
fi
|
||||
;;
|
||||
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
if start-stop-daemon --stop --name $NAME --user root --quiet \
|
||||
--pidfile $PIDFILE --remove-pidfile --oknodo --retry 5; then
|
||||
# prevents cryptsetup/dmsetup hangs (see #791944)
|
||||
rm -f $CTRLFILE
|
||||
log_end_msg $?
|
||||
else
|
||||
log_end_msg $?
|
||||
fi
|
||||
;;
|
||||
|
||||
restart)
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
if start-stop-daemon --stop --name $NAME --user root --quiet \
|
||||
--pidfile $PIDFILE --remove-pidfile --oknodo --retry 5; then
|
||||
# prevents cryptsetup/dmsetup hangs (see #791944)
|
||||
rm -f $CTRLFILE
|
||||
log_end_msg $?
|
||||
else
|
||||
log_end_msg $? || true
|
||||
fi
|
||||
|
||||
log_daemon_msg "Starting $DESC" "$NAME"
|
||||
if start-stop-daemon --start --name $NAME --user root --quiet \
|
||||
--pidfile $PIDFILE --exec $DAEMON --background --make-pidfile \
|
||||
--notify-await; then
|
||||
# prevents udevd to be killed by sendsigs (see #791944)
|
||||
mkdir -p $OMITDIR
|
||||
ln -sf $PIDFILE $OMITDIR/$NAME
|
||||
log_end_msg $?
|
||||
else
|
||||
log_end_msg $?
|
||||
fi
|
||||
;;
|
||||
|
||||
reload|force-reload)
|
||||
udevadm control --reload-rules
|
||||
;;
|
||||
|
||||
status)
|
||||
status_of_proc $DAEMON $NAME && exit 0 || exit $?
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: /etc/init.d/udev {start|stop|restart|reload|force-reload|status}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+51
@@ -0,0 +1,51 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Required-Start: $local_fs $remote_fs
|
||||
# Required-Stop: $local_fs $remote_fs
|
||||
# Provides: unattended-upgrade-shutdown-check
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Check if unattended upgrades are being applied
|
||||
# Description: Check if unattended upgrades are being applied
|
||||
# and wait for them to finish
|
||||
### END INIT INFO
|
||||
set -e
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
NAME="unattended-upgrades-shutdown"
|
||||
DESC="unattended package upgrades shutdown"
|
||||
SCRIPTNAME="/etc/init.d/$NAME"
|
||||
SHUTDOWN_HELPER="/usr/share/unattended-upgrades/unattended-upgrade-shutdown"
|
||||
|
||||
if [ -x /usr/bin/python3 ]; then
|
||||
PYTHON=python3
|
||||
else
|
||||
PYTHON=python
|
||||
fi
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
case "$1" in
|
||||
start|restart|force-reload|status)
|
||||
# nothing, just to keep update-rc.d happy (see debian #630732)
|
||||
;;
|
||||
stop)
|
||||
if [ -e $SHUTDOWN_HELPER ]; then
|
||||
[ "$VERBOSE" != "no" ] && log_action_begin_msg "Checking for running $DESC"
|
||||
$PYTHON $SHUTDOWN_HELPER
|
||||
[ "$VERBOSE" != "no" ] && log_action_end_msg $? "$NAME"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
:
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
#! /bin/sh -e
|
||||
### BEGIN INIT INFO
|
||||
# Provides: uuidd
|
||||
# Required-Start: $time $local_fs $remote_fs
|
||||
# Required-Stop: $time $local_fs $remote_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: uuidd daemon
|
||||
# Description: Init script for the uuid generation daemon
|
||||
### END INIT INFO
|
||||
#
|
||||
# Author: "Theodore Ts'o" <tytso@mit.edu>
|
||||
#
|
||||
set -e
|
||||
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||
DAEMON=/usr/sbin/uuidd
|
||||
UUIDD_USER=uuidd
|
||||
UUIDD_GROUP=uuidd
|
||||
UUIDD_DIR=/run/uuidd
|
||||
PIDFILE=$UUIDD_DIR/uuidd.pid
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting uuid generator" "uuidd"
|
||||
if ! test -d $UUIDD_DIR; then
|
||||
mkdir -p $UUIDD_DIR
|
||||
chown -R $UUIDD_USER:$UUIDD_GROUP $UUIDD_DIR
|
||||
fi
|
||||
start_daemon -p $PIDFILE $DAEMON
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping uuid generator" "uuidd"
|
||||
killproc -p $PIDFILE $DAEMON
|
||||
log_end_msg $?
|
||||
;;
|
||||
status)
|
||||
if pidofproc -p $PIDFILE $DAEMON >/dev/null 2>&1; then
|
||||
echo "$DAEMON is running";
|
||||
exit 0;
|
||||
else
|
||||
echo "$DAEMON is NOT running";
|
||||
if test -f $PIDFILE; then exit 2; fi
|
||||
exit 3;
|
||||
fi
|
||||
;;
|
||||
force-reload|restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/uuidd {start|stop|restart|force-reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+167
@@ -0,0 +1,167 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright 2015 VMware, Inc. All rights reserved.
|
||||
#
|
||||
# This script manages the VMware USB Arbitrator service
|
||||
#
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: vmware-USBArbitrator
|
||||
# Required-Start: localfs
|
||||
# Required-Stop: localfs
|
||||
# X-Start-Before:
|
||||
# X-Stop-After:
|
||||
# Default-Start: 2 3 4
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: This services starts and stops the USB Arbitrator.
|
||||
### END INIT INFO
|
||||
|
||||
|
||||
if [ -f /etc/vmware/bootstrap ]; then
|
||||
# Load bootstrapper info
|
||||
. /etc/vmware/bootstrap
|
||||
else
|
||||
BINDIR=/usr/bin
|
||||
fi
|
||||
|
||||
# This defines $rc_done and $rc_failed on S.u.S.E.
|
||||
if [ -f /etc/rc.config ]; then
|
||||
# Don't include the entire file: there could be conflicts
|
||||
rc_done=`(. /etc/rc.config; echo "$rc_done")`
|
||||
rc_failed=`(. /etc/rc.config; echo "$rc_failed")`
|
||||
else
|
||||
# Make sure the ESC byte is literal: Ash does not support echo -e
|
||||
rc_done='[71G done'
|
||||
rc_failed='[71Gfailed'
|
||||
fi
|
||||
|
||||
# This defines echo_success() and echo_failure() on RedHat
|
||||
if [ -r "$INITSCRIPTDIR"'/functions' ]; then
|
||||
. "$INITSCRIPTDIR"'/functions'
|
||||
fi
|
||||
|
||||
vmware_failed() {
|
||||
if [ "`type -t 'echo_failure' 2>/dev/null`" = 'function' ]; then
|
||||
echo_failure
|
||||
else
|
||||
echo -n "$rc_failed"
|
||||
fi
|
||||
}
|
||||
|
||||
vmware_success() {
|
||||
if [ "`type -t 'echo_success' 2>/dev/null`" = 'function' ]; then
|
||||
echo_success
|
||||
else
|
||||
echo -n "$rc_done"
|
||||
fi
|
||||
}
|
||||
|
||||
# Execute a macro
|
||||
vmware_exec() {
|
||||
local msg="$1" # IN
|
||||
local func="$2" # IN
|
||||
shift 2
|
||||
|
||||
# On Caldera 2.2, SIGHUP is sent to all our children when this script exits
|
||||
# I wanted to use shopt -u huponexit instead but their bash version
|
||||
# 1.14.7(1) is too old
|
||||
#
|
||||
# Ksh does not recognize the SIG prefix in front of a signal name
|
||||
if [ "$VMWARE_DEBUG" = 'yes' ]; then
|
||||
(trap '' HUP; "$func" "$@")
|
||||
else
|
||||
(trap '' HUP; "$func" "$@") >/dev/null 2>&1
|
||||
fi
|
||||
if [ "$?" -gt 0 ]; then
|
||||
vmware_failed
|
||||
echo
|
||||
return 1
|
||||
fi
|
||||
|
||||
vmware_success
|
||||
echo
|
||||
return 0
|
||||
}
|
||||
|
||||
# Create socket dir for usbd
|
||||
vmwareCreateUDSDirForUsbd() {
|
||||
for user in `awk -F'[/:]' '{if ($3 == 0 || ($3 >= 500 && $3 != 65534)) print $1}' /etc/passwd`
|
||||
do
|
||||
aUser=$user
|
||||
aGroup=`id -g $aUser`
|
||||
aUID=`id -u $aUser`
|
||||
if ! [ -d /var/run/vmware/"$aUID" ] ; then
|
||||
mkdir -p /var/run/vmware/"$aUID"
|
||||
chown -R -- "$aUser":"$aGroup" /var/run/vmware/"$aUID"
|
||||
chmod 700 /var/run/vmware/"$aUID"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Remove socket dir for usbd
|
||||
vmwareRemoveUDSDirForUsbd() {
|
||||
for uid in `awk -F'[/:]' '{if ($3 == 0 || ($3 >= 500 && $3 != 65534)) print $3}' /etc/passwd`
|
||||
do
|
||||
if [ -d /var/run/vmware/"$uid" ] ; then
|
||||
rm -f /var/run/vmware/"$uid"/*
|
||||
rmdir /var/run/vmware/"$uid"
|
||||
fi
|
||||
done
|
||||
|
||||
rmdir /var/run/vmware
|
||||
}
|
||||
|
||||
# Start the virtual machine USB Arbitrator service
|
||||
vmwareStartUSBArbitrator() {
|
||||
vmwareCreateUDSDirForUsbd
|
||||
# The executable checks for already running instances, so it
|
||||
# is safe to just run it.
|
||||
"$BINDIR"/vmware-usbarbitrator
|
||||
}
|
||||
|
||||
# Stop the virtual machine USB Arbitrator service
|
||||
vmwareStopUSBArbitrator() {
|
||||
# The service knows how to stop itself.
|
||||
"$BINDIR"/vmware-usbarbitrator --kill
|
||||
# Do some cleaning job.
|
||||
vmwareRemoveUDSDirForUsbd
|
||||
}
|
||||
|
||||
vmwareService() {
|
||||
case "$1" in
|
||||
start)
|
||||
vmware_exec 'VMware USB Arbitrator' vmwareStartUSBArbitrator
|
||||
exitcode=$(($exitcode + $?))
|
||||
if [ "$exitcode" -gt 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
vmware_exec 'VMware USB Arbitrator' vmwareStopUSBArbitrator
|
||||
exitcode=$(($exitcode + $?))
|
||||
if [ "$exitcode" -gt 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
"$SCRIPTNAME" stop && "$SCRIPTNAME" start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $BASENAME {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
}
|
||||
|
||||
SCRIPTNAME="$0"
|
||||
BASENAME=`basename "$SCRIPTNAME"`
|
||||
|
||||
# Check permissions
|
||||
if [ "`id -ur`" != '0' ]; then
|
||||
echo 'Error: you must be root.'
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
vmwareService "$1"
|
||||
|
||||
exit 0
|
||||
Executable
+122
@@ -0,0 +1,122 @@
|
||||
#!/bin/sh
|
||||
# /etc/init.d/x11-common: set up the X server and ICE socket directories
|
||||
### BEGIN INIT INFO
|
||||
# Provides: x11-common
|
||||
# Required-Start: $remote_fs
|
||||
# Required-Stop: $remote_fs
|
||||
# Default-Start: S
|
||||
# Default-Stop:
|
||||
# Short-Description: set up the X server and ICE socket directories
|
||||
### END INIT INFO
|
||||
|
||||
set -e
|
||||
|
||||
PATH=/usr/bin:/usr/sbin:/bin:/sbin
|
||||
SOCKET_DIR=.X11-unix
|
||||
ICE_DIR=.ICE-unix
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
if [ -f /etc/default/rcS ]; then
|
||||
. /etc/default/rcS
|
||||
fi
|
||||
|
||||
do_restorecon () {
|
||||
# Restore file security context (SELinux).
|
||||
if which restorecon >/dev/null 2>&1; then
|
||||
restorecon "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# create a directory in /tmp.
|
||||
# assumes /tmp has a sticky bit set (or is only writeable by root)
|
||||
set_up_dir () {
|
||||
DIR="/tmp/$1"
|
||||
|
||||
if [ "$VERBOSE" != no ]; then
|
||||
log_progress_msg "$DIR"
|
||||
fi
|
||||
# if $DIR exists and isn't a directory, move it aside
|
||||
if [ -e $DIR ] && ! [ -d $DIR ] || [ -h $DIR ]; then
|
||||
mv "$DIR" "$(mktemp -d $DIR.XXXXXX)"
|
||||
fi
|
||||
|
||||
error=0
|
||||
while :; do
|
||||
if [ $error -ne 0 ] ; then
|
||||
# an error means the file-system is readonly or an attacker
|
||||
# is doing evil things, distinguish by creating a temporary file,
|
||||
# but give up after a while.
|
||||
if [ $error -gt 5 ]; then
|
||||
log_failure_msg "failed to set up $DIR"
|
||||
return 1
|
||||
fi
|
||||
fn="$(mktemp /tmp/testwriteable.XXXXXXXXXX)" || return 1
|
||||
rm "$fn"
|
||||
fi
|
||||
mkdir -p -m 01777 "$DIR" || { rm "$DIR" || error=$((error + 1)) ; continue ; }
|
||||
case "$(LC_ALL=C stat -c '%u %g %a %F' "$DIR")" in
|
||||
"0 0 1777 directory")
|
||||
# everything as it is supposed to be
|
||||
break
|
||||
;;
|
||||
"0 0 "*" directory")
|
||||
# as it is owned by root, cannot be replaced with a symlink:
|
||||
chmod 01777 "$DIR"
|
||||
break
|
||||
;;
|
||||
*" directory")
|
||||
# if the chown succeeds, the next step can change it savely
|
||||
chown -h root:root "$DIR" || error=$((error + 1))
|
||||
continue
|
||||
;;
|
||||
*)
|
||||
log_failure_msg "failed to set up $DIR"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
do_restorecon "$DIR"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
do_status () {
|
||||
if [ -d "/tmp/$ICE_DIR" ] && [ -d "/tmp/$SOCKET_DIR" ]; then
|
||||
return 0
|
||||
else
|
||||
return 4
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if [ "$VERBOSE" != no ]; then
|
||||
log_begin_msg "Setting up X socket directories..."
|
||||
fi
|
||||
set_up_dir "$SOCKET_DIR"
|
||||
set_up_dir "$ICE_DIR"
|
||||
if [ "$VERBOSE" != no ]; then
|
||||
log_end_msg 0
|
||||
fi
|
||||
;;
|
||||
|
||||
restart|reload|force-reload)
|
||||
/etc/init.d/x11-common start
|
||||
;;
|
||||
|
||||
stop)
|
||||
:
|
||||
;;
|
||||
|
||||
status)
|
||||
do_status
|
||||
;;
|
||||
*)
|
||||
log_success_msg "Usage: /etc/init.d/x11-common {start|stop|status|restart|reload|force-reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# vim:set ai et sts=2 sw=2 tw=0:
|
||||
Executable
+84
@@ -0,0 +1,84 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: xinetd inetd
|
||||
# Required-Start: $local_fs $remote_fs $network
|
||||
# Required-Stop: $local_fs $remote_fs $network
|
||||
# Should-Start: $syslog
|
||||
# Should-Stop: $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Starts or stops the xinetd daemon.
|
||||
# Description: Starts and stops xinetd, an inetd replacement
|
||||
### END INIT INFO
|
||||
|
||||
# clear poisonned environment
|
||||
unset TMPDIR
|
||||
|
||||
NAME=xinetd
|
||||
DAEMON=/usr/sbin/$NAME
|
||||
PIDFILE=/run/$NAME.pid
|
||||
|
||||
test -x "$DAEMON" || exit 0
|
||||
|
||||
test -e /etc/default/$NAME && . /etc/default/$NAME
|
||||
case "$INETD_COMPAT" in
|
||||
[Yy]*)
|
||||
XINETD_OPTS="$XINETD_OPTS -inetd_compat"
|
||||
if perl -MSocket -e 'exit (!socket($sock, AF_INET6, SOCK_STREAM, 0))'; then
|
||||
XINETD_OPTS="$XINETD_OPTS -inetd_ipv6"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
checkportmap () {
|
||||
if grep "^[^ *#]" /etc/xinetd.conf | grep -q 'rpc/'; then
|
||||
if ! rpcinfo -u localhost portmapper >/dev/null 2>&1; then
|
||||
echo
|
||||
echo "WARNING: portmapper inactive - RPC services unavailable!"
|
||||
echo " Commenting out or removing the RPC services from"
|
||||
echo " the /etc/xinetd.conf file will remove this message."
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
checkportmap
|
||||
log_daemon_msg "Starting internet superserver" "$NAME"
|
||||
start-stop-daemon --pidfile "$PIDFILE" --start --quiet --background --exec "$DAEMON" -- \
|
||||
-pidfile "$PIDFILE" $XINETD_OPTS
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping internet superserver" "$NAME"
|
||||
start-stop-daemon --pidfile "$PIDFILE" --stop --signal 3 --quiet --oknodo --exec "$DAEMON"
|
||||
log_end_msg $?
|
||||
;;
|
||||
reload)
|
||||
log_daemon_msg "Reloading internet superserver configuration" "$NAME"
|
||||
start-stop-daemon --pidfile "$PIDFILE" --stop --signal 1 --quiet --oknodo --exec "$DAEMON"
|
||||
log_end_msg $?
|
||||
;;
|
||||
restart|force-reload)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
status)
|
||||
status_of_proc -p "$PIDFILE" "$DAEMON"
|
||||
R=$?
|
||||
if test "$R" = "0" ; then
|
||||
kill -10 $(cat "$PIDFILE")
|
||||
cat /var/run/xinetd.dump
|
||||
fi
|
||||
exit $R
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/xinetd {start|stop|reload|force-reload|restart|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user