]> git.pld-linux.org Git - projects/rc-scripts.git/blame - rc.d/init.d/functions
Silent modprobe.
[projects/rc-scripts.git] / rc.d / init.d / functions
CommitLineData
356d834b 1#!/bin/sh - keep it for file(1) to get bourne shell script result
7742e157 2# functions This file contains functions to be used by most or all
746a2130 3# shell scripts in the /etc/rc.d/init.d directory.
7742e157 4#
ec8b15cb 5# $Id$
7742e157
AF
6#
7# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
8a835e11 8# Hacked by: Greg Galloway and Marc Ewing
ffe19b59 9# Modified for PLD Linux by:
ec8b15cb 10# Marek Obuchowicz <elephant@pld-linux.org>
fdc764ae
ER
11# Arkadiusz Miśkiewicz <misiek@pld-linux.org>
12# Michał Kochanowicz <mkochano@pld-linux.org>
13# Łukasz Pawelczyk <havner@pld-linux.org>
7742e157
AF
14
15# First set up a default search path.
f2dd2d31 16export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
7742e157 17
d7e5835b 18# Set defaults
66f7cfac
ER
19if [ -z "$COLUMNS" -o -z "$LINES" ]; then
20 _setterm() {
21 set -- $(stty size 2>/dev/null)
22 LINES=${LINES:-$1}
23 COLUMNS=${COLUMNS:-$2}
24 }
25 _setterm
26 unset _setterm
27fi
ef72e56c
AM
28[ -z "$LINES" ] || [ "$LINES" -le 0 ] && LINES=40
29[ -z "$COLUMNS" ] || [ "$COLUMNS" -le 0 ] && COLUMNS=80
66f7cfac
ER
30export LINES COLUMNS
31INIT_COL=$((COLUMNS - 13))
9e9fac7d 32
503bfc80
AM
33# Set colors
34RED=1
35GREEN=2
36YELLOW=3
37BLUE=4
38MAGENTA=5
39CYAN=6
40WHITE=7
94b691da 41NORMAL=15
503bfc80
AM
42# Bold definition (second parameter to termput setaf)
43BOLD=1
44NOBOLD=0
45# Default colors
46CBRACKETS="$CYAN" # brackets [ ] color
47CDONE="$GREEN" # DONE and WORK color
48CBUSY="$MAGENTA" # BUSY color
49CFAIL="$RED" # FAIL and DIED color
50CPOWEREDBY="$CYAN" # "Powered by" color
51CPLD="$GREEN" # "PLD Linux Distribution" color
52CI="$RED" # Capital I color (press I to enter interactive startup)
53CRESMAN="$GREEN" # "Resource Manager" color
bca43764 54CHARS="" # Characters displayed on the beginning of show line
503bfc80
AM
55CCHARS="$NORMAL" # Color of these characters (look at /etc/sysconfig/init-colors.gentoo example)
56
d7e5835b 57# Source configuration if available - may override default values
503bfc80 58[ -r /etc/sysconfig/init-colors ] && . /etc/sysconfig/init-colors
de1fc6ce 59[ -r /etc/sysconfig/system ] && . /etc/sysconfig/system
7f229d88 60[ -r /etc/sysconfig/bootsplash ] && . /etc/sysconfig/bootsplash
7e04fe0e 61
9e22837c 62if [ -z "$VSERVER" -o "$VSERVER" = "detect" ]; then
ce397bd8
JR
63 {
64 while read _f _ctx; do
65 [ "$_f" = "VxID:" -o "$_f" = "s_context:" ] && break
66 done </proc/self/status
67 } 2>/dev/null
9e22837c
JR
68 if [ -z "$_ctx" -o "$_ctx" = "0" ]; then
69 VSERVER=no
70 else
71 VSERVER=yes
72 fi
55a4bc1b 73 unset _f _ctx
9e22837c
JR
74fi
75
4132441e
ER
76# we need to know in functions if we were called from a terminal
77if [ -z "$ISATTY" ]; then
78 [ -t ] && ISATTY=yes || ISATTY=no
9cdf2de7 79 export ISATTY
4132441e
ER
80fi
81
18bd13ac 82is_yes() {
13a745bb 83 # Test syntax
ac1f65e1 84 if [ $# = 0 ]; then
13a745bb
AM
85 msg_usage " is_yes {value}"
86 return 2
87 fi
88
89 # Check value
90 case "$1" in
739070c4 91 yes|Yes|YES|true|True|TRUE|on|On|ON|Y|y|1)
13a745bb
AM
92 # true returns zero
93 return 0
94 ;;
739070c4 95 *)
13a745bb
AM
96 # false returns one
97 return 1
98 ;;
99 esac
100}
101
18bd13ac 102is_no() {
13a745bb 103 # Test syntax
ac1f65e1 104 if [ $# = 0 ]; then
13a745bb
AM
105 msg_usage " is_no {value}"
106 return 2
107 fi
108
109 case "$1" in
739070c4 110 no|No|NO|false|False|FALSE|off|Off|OFF|N|n|0)
13a745bb
AM
111 # true returns zero
112 return 0
113 ;;
739070c4 114 *)
13a745bb
AM
115 # false returns one
116 return 1
117 ;;
118 esac
119}
120
45e0ac73
ER
121# checks if file is empty
122# empty lines and lines beginning with hash are ignored
123is_empty_file() {
124 [ -s "$1" ] || return 0
a51d5138 125 grep -vqE "^(#|[[:blank:]]*$)" "$1" && return 1 || return 0
45e0ac73
ER
126}
127
1626fc86
ER
128# returns OK if $1 contains $2
129strstr() {
4ec13019
ER
130 local a=$2
131 [ "${1#*$a*}" = "$1" ] && return 1
1626fc86
ER
132 return 0
133}
134
bc94aa53 135if is_yes "$FASTRC" || is_yes "$IN_SHUTDOWN"; then
d84e0c78
JR
136 RC_LOGGING=no
137fi
138
bc94aa53 139if is_no "$RC_LOGGING"; then
18bd13ac 140 initlog() {
6d0838f4 141 RESULT=0
bb49a1c7 142 while [ "$1" != "${1##-}" ]; do
0a35929a 143 case $1 in
739070c4 144 -c)
5e6dfc29
JR
145 shift
146 $1
147 RESULT=$?
148 break
149 ;;
739070c4 150 *)
5e6dfc29
JR
151 shift
152 ;;
0a35929a
AM
153 esac
154 done
6d0838f4 155 return $RESULT
0a35929a
AM
156 }
157fi
158
18bd13ac 159kernelver() {
944d6d80 160 local _x _y _z v old_IFS ver
55a4bc1b
JR
161 {
162 read _x _y v _z
163 old_IFS=$IFS
164 IFS='.'
165 set -- $v
166 IFS=$old_IFS
28d62f54
ER
167
168 # strip _* or -* from versions like: "2.6.25_vanilla-1", "2.6.25-1"
89ec4154 169 ver=${3%%[-_]*}
28d62f54
ER
170
171 while [ ${#ver} -lt 3 ]; do ver="0$ver"; done
55a4bc1b 172 ver="$2$ver"
28d62f54 173 while [ ${#ver} -lt 6 ]; do ver="0$ver"; done
55a4bc1b 174 ver="$1$ver"
28d62f54 175 while [ ${#ver} -lt 9 ]; do ver="0$ver"; done
55a4bc1b 176 echo $ver
28d62f54 177 } < /proc/version
6f2d09b1
AM
178}
179
18bd13ac 180kernelverser() {
944d6d80 181 local _x _y _z v old_IFS ver
55a4bc1b
JR
182 {
183 read _x _y v _z
184 old_IFS=$IFS
185 IFS='.'
186 set -- $v
187 IFS=$old_IFS
188 ver=$2
ac1f65e1 189 while [ ${#ver} -lt 3 ]; do ver="0$ver"; done
55a4bc1b 190 ver="$1$ver"
ac1f65e1 191 while [ ${#ver} -lt 6 ]; do ver="0$ver"; done
55a4bc1b
JR
192 echo $ver
193 } </proc/version
6f2d09b1
AM
194}
195
18bd13ac 196kernelvermser() {
944d6d80 197 local _x _y _z v old_IFS ver
55a4bc1b
JR
198 {
199 read _x _y v _z
200 old_IFS=$IFS
201 IFS='.'
202 set -- $v
203 IFS=$old_IFS
204 ver="$1$ver"
ac1f65e1 205 while [ ${#ver} -lt 3 ]; do ver="0$ver"; done
55a4bc1b
JR
206 echo $ver
207 } </proc/version
6f2d09b1
AM
208}
209
cee18a41 210# Colors workaround
18bd13ac 211termput() {
4132441e 212 is_yes "$ISATTY" || return
e3aafb2f 213
294b03eb 214 if is_yes "$FASTRC" || is_no "$TPUT"; then
972964bb 215 case "$1" in
739070c4 216 hpa)
8a835e11 217 echo -ne "\033[$(($2+1))G"
972964bb 218 ;;
739070c4 219 cuu*)
8a835e11 220 echo -ne "\033[${2}A"
972964bb 221 ;;
739070c4 222 el)
8a835e11 223 echo -ne "\033[0K"
972964bb 224 ;;
739070c4 225 setaf)
944d6d80 226 local ISBOLD
503bfc80
AM
227 if [ -n "$3" ]; then
228 ISBOLD="$3"
229 else
230 ISBOLD="$NOBOLD";
231 fi
232 is_yes "$COLOR_INIT" && echo -ne "\033[${ISBOLD};3${2}m"
8a835e11 233 ;;
739070c4 234 op)
503bfc80 235 termput setaf $NORMAL
dcb00bd9 236 ;;
8a835e11 237 esac
c6c1bd0c 238 else
8a835e11 239 case "$1" in
739070c4 240 hpa | cuu* | el)
8a835e11 241 tput "$@"
945790a2 242 ;;
739070c4 243 setaf)
ac1f65e1 244 if [ "$3" = "1" ]; then tput bold; else tput sgr0; fi
503bfc80 245 is_yes "$COLOR_INIT" && tput setaf "$2"
945790a2 246 ;;
739070c4 247 op)
503bfc80 248 termput setaf $NORMAL
945790a2 249 ;;
8a835e11 250 esac
c6c1bd0c
AF
251 fi
252}
cee18a41 253
0c4f3cf5
ER
254if [ ! -x /bin/printf ]; then
255 # printf equivalent
256 # FIXME: buggy when single or double quotes in message!
18bd13ac 257 printf() {
944d6d80 258 local text m
0c4f3cf5
ER
259 text="$1"
260 shift
261 if [ $# -gt 0 ]; then
262 m="$1"
263 shift
264 while [ $# -gt 0 ]; do
265 m="$m\",\"$1"
266 shift
267 done
268 fi
269 awk "BEGIN {printf \"$text\", \"$m\"; }"
270 }
271fi
8a835e11 272
38198f50 273# National language support function
18bd13ac 274nls() {
944d6d80 275 local msg_echo nls_domain text message
d553f606 276 msg_echo='\n'
50ed8c3f 277 nls_domain="$NLS_DOMAIN"
e2c2c3a6 278 while [ "$1" != "${1##-}" ]; do
d553f606 279 case "$1" in
739070c4 280 --nls-domain)
8a835e11 281 shift
50ed8c3f 282 nls_domain="$1"
8a835e11 283 shift
284 ;;
739070c4 285 -n)
8a835e11 286 msg_echo=''
287 shift
288 ;;
d553f606
JR
289 esac
290 done
291 message="$1"
292 shift
50ed8c3f 293
d553f606
JR
294 # empty message, so we return --misiek
295 if [ -z "$message" ]; then
d553f606
JR
296 echo -en "$msg_echo"
297 return
38198f50 298 fi
8a835e11 299
e2c2c3a6
ER
300 if is_yes "$GETTEXT"; then
301 message=$(TEXTDOMAINDIR="/etc/sysconfig/locale" gettext -e --domain="${nls_domain:-rc-scripts}" "$message")
972964bb 302 fi
8a835e11 303
e2c2c3a6 304 printf "$message" "$@"
d553f606 305 echo -en "$msg_echo"
38198f50
AM
306}
307
18bd13ac 308rc_splash() {
944d6d80 309 local action="$1"
862c980c 310
9e22837c 311 if ! is_no "$BOOT_SPLASH" && ! is_yes "$VSERVER"; then
fae22957
AM
312 [ -x /bin/splash ] && /bin/splash "$action"
313 fi
b6509675
AM
314
315 : $((progress++))
fae22957
AM
316}
317
18bd13ac 318msg_network_down() {
228edf1d 319 nls "ERROR: Networking is down. %s can't be run." "$1" >&2
a916d1c6 320}
321
18bd13ac 322msg_starting() {
a916d1c6 323 show "Starting %s service" "$1"
324}
325
18bd13ac 326msg_already_running() {
599d198a 327 nls "%s service is already running." "$1"
a916d1c6 328}
329
18bd13ac 330msg_stopping() {
a916d1c6 331 show "Stopping %s service" "$1"
332}
333
18bd13ac 334msg_not_running() {
599d198a 335 nls "%s service is not running." "$1"
a916d1c6 336}
337
18bd13ac 338msg_reloading() {
a916d1c6 339 show "Reloading %s service" "$1"
340}
341
18bd13ac 342msg_usage() {
599d198a 343 nls "Usage: %s" "$*"
a916d1c6 344}
345
ffe19b59 346# Some functions to handle PLD Linux-style messages
18bd13ac 347show() {
944d6d80 348 local text len
0a35929a 349
ce410bbc
JR
350 if is_no "$FASTRC" && is_yes "$GETTEXT"; then
351 text=$(nls -n "$@")
352 else
353 text=$(printf "$@")
354 fi
355 len=${#text}
356 while [ $((len++)) -lt $INIT_COL ]; do
357 text="$text."
358 done
359 if [ -n "$CHARS" ]; then
360 termput setaf $CCHARS
361 echo -n "$CHARS"
362 termput op
363 fi
364 echo -n "$text"
7742e157
AF
365}
366
18bd13ac 367deltext() {
a292b175
ER
368 termput hpa $INIT_COL
369}
370
b9cad282 371# Displays message in square brackests ("[ DONE ]"). Takes two arguments.
372# First is the text to display, second is color number to use (argument to
373# tput setaf). If second argument is not given, default (2, green) will be
374# used).
18bd13ac 375progress() {
944d6d80
ER
376 local COLOR
377 if [ -n "$2" ]; then
378 COLOR="$2"
379 else
380 COLOR="$CDONE"
381 fi
cd8dfdf0 382 deltext
503bfc80 383 echo -n "$(termput setaf $CBRACKETS)[$(termput setaf $COLOR) $(nls --nls-domain rc-scripts "$1") $(termput setaf $CBRACKETS)]$(termput op)"
b9cad282 384}
385
18bd13ac 386busy() {
a292b175 387 echo -n "$_busy"
7742e157
AF
388}
389
18bd13ac 390ok() {
a292b175 391 echo "$_ok"
7742e157
AF
392}
393
18bd13ac 394started() {
a292b175 395 echo "$_started"
7e04fe0e 396}
397
18bd13ac 398fail() {
a292b175 399 echo "$_fail"
d553f606 400 return 1
7742e157
AF
401}
402
18bd13ac 403died() {
a292b175 404 echo "$_died"
d553f606 405 return 1
6cac3cb2 406}
407
bbb612de 408# Check if $pid (could be plural) are running
18bd13ac 409checkpid() {
8a835e11 410 while [ "$1" ]; do
411 [ -d "/proc/$1" ] && return 0
412 shift
413 done
414 return 1
bbb612de
AM
415}
416
290eb891
AM
417# - outside chroot get only those processes, which are outside chroot.
418# - inside chroot get only those processes, which are inside chroot.
419# - don't filter out pids which do not have corresponding running processes (process died etc)
1e5e8177 420# (note: some processes like named are chrooted but run outside chroot)
c3403882 421# - do nothing inside vserver
18bd13ac 422filter_chroot() {
c3403882
JR
423 if is_yes "$VSERVER"; then
424 echo $@
425 return
426 fi
ac1f65e1 427 if [ $# -lt 1 -o ! -d /proc/1 ]; then
8e3b6875
AM
428 echo $@
429 return
430 fi
33ca787f 431 local root_dir good_pids="" good_add_pid
1e5e8177
AM
432 for root_pid in $@; do
433 root_dir=$(resolvesymlink /proc/${root_pid}/root)
434 if [ -n "$root_dir" ]; then
5a8ff397
AM
435 good_add_pid=1
436 if [ -n "${SYSTEM_CHROOTS}" ]; then
437 for r_dir in ${SYSTEM_CHROOTS}; do
438 echo "$root_dir" | grep -q "^${r_dir}" && good_add_pid=0
439 done
440 fi
441 [ "$good_add_pid" -eq 1 ] && good_pids="$good_pids $root_pid"
290eb891
AM
442 elif [ ! -d "/proc/$root_pid" ]; then
443 good_pids="$good_pids $root_pid"
1e5e8177 444 fi
5a8ff397
AM
445 done
446 echo $good_pids
1e5e8177
AM
447}
448
cee18a41 449# Usage run_cmd Message command_to_run
18bd13ac 450run_cmd() {
944d6d80
ER
451 local exit_code errors message force_err
452 local force_err=0 exit_code=0
d553f606 453 case "$1" in
739070c4 454 -a)
8a835e11 455 force_err=1
456 shift
457 ;;
d553f606
JR
458 esac
459 message=$1
460 show "$message"; busy
1b228409 461 shift
90c59319 462 cd /
f10f2102
ER
463 if errors=$(
464 export HOME=/tmp TMPDIR=/tmp
465 if is_no "$RC_LOGGING"; then
466 "$@" 2>&1
467 else
468 initlog -c "$*" 2>&1
469 fi
470 ); then
cd8dfdf0 471 ok
d553f606 472 log_success "$1 $message"
1b228409 473 else
d553f606
JR
474 fail
475 log_failed "$1 $message"
b7299ffc 476 exit_code=1
1b228409 477 fi
d553f606 478 [ -n "$errors" ] && [ $exit_code -eq 1 -o $force_err -eq 1 ] && echo "$errors"
1b228409 479 return $exit_code
cee18a41
AM
480}
481
e81194ca 482_daemon_set_ulimits() {
0fba6fe4
ER
483 local opt val ksh=${KSH_VERSION:+1}
484 set -- ${SERVICE_LIMITS:-$DEFAULT_SERVICE_LIMITS}
485 while [ $# -gt 0 ]; do
486 opt=$1
487 val=$2
488 if [ "$ksh" ]; then
489 case "$opt" in
490 -Hu)
491 opt=-Hp
492 ;;
493 -Su)
494 opt=-Sp
495 ;;
496 -u)
497 opt=-p
498 ;;
499 esac
500 fi
501 ulimit $opt $val
502 shift 2
503 done
e81194ca
ER
504}
505
e2e24f5a 506# A function to start a program (now it's useful on read-only filesystem too)
18bd13ac 507daemon() {
944d6d80
ER
508 local errors="" prog="" end="" waitname="" waittime=""
509 local exit_code=0
42595a81 510 local nice=$SERVICE_RUN_NICE_LEVEL
64c571c5 511 local fork user closefds redirfds pidfile makepid chdir=/
42595a81 512
210ff16f
ER
513 # NOTE: if you wonder how the shellish (by syntax) $prog works in ssd mode,
514 # then the answer is: it totally ignores $prog and uses "$@" itself.
515
42595a81 516 while [ $# -gt 0 ]; do
d553f606 517 case $1 in
739070c4 518 '')
64c571c5 519 msg_usage " daemon [--check] [--user user] [--fork] [--chdir directory] [--closefds] [--redirfds] [--waitforname procname] [--waitfortime seconds] [--pidfile file] [--makepid] [+/-nicelevel] {program} <program args>"
8a835e11 520 return 2
d553f606 521 ;;
739070c4 522 --check)
d553f606
JR
523 # for compatibility with redhat/mandrake
524 nls "warning: --check option is ignored!"
525 shift
d553f606 526 ;;
739070c4 527 --user)
d553f606 528 shift
7b1a2a70 529 [ "$1" != "root" ] && prog="/bin/su $1 -s /bin/sh -c \""
f10f2102 530 user=$1
d553f606 531 ;;
739070c4
ER
532 --fork)
533 fork=1
b486c392
ER
534 prog="/usr/bin/setsid sh -c \""
535 end='&'
b486c392 536 ;;
6b1fd029
ER
537 --chdir)
538 shift
539 chdir=$1
540 ;;
739070c4
ER
541 --closefds)
542 closefds=1
f10f2102 543 ;;
64c571c5
ER
544 --redirfds)
545 redirfds=1
546 ;;
739070c4 547 --waitforname)
b486c392 548 shift
683d384e 549 waitname="$1"
683d384e 550 ;;
739070c4 551 --waitfortime)
b486c392 552 shift
683d384e 553 waittime="$1"
683d384e 554 ;;
739070c4 555 --pidfile)
0a177614
ER
556 shift
557 pidfile="$1"
5bf237b7 558 case "$pidfile" in /*);; *) pidfile="/var/run/$pidfile";; esac
0a177614 559 ;;
a160c01b
PG
560 --makepid)
561 makepid=1
562 ;;
739070c4 563 -*|+*)
42595a81 564 nice=$1
a6e727aa 565 shift
42595a81
ER
566 break
567 ;;
739070c4 568 *)
42595a81 569 break
683d384e 570 ;;
d553f606 571 esac
42595a81 572 shift
d553f606 573 done
2eea8492 574 # If command to execute ends with quotation mark, add remaining
575 # arguments and close quotation.
576 if [ "$prog" != "${prog%\"}" ]; then
565736ed 577 prog="$prog $*$end\""
2eea8492 578 else
565736ed 579 prog="$prog $*$end"
2eea8492 580 fi
7742e157 581
e81194ca 582 _daemon_set_ulimits
f054a85e 583
3edf5e48 584 [ -z "$DEFAULT_SERVICE_UMASK" ] && DEFAULT_SERVICE_UMASK=022
42595a81 585 [ -z "$DEFAULT_SERVICE_RUN_NICE_LEVEL" ] && DEFAULT_SERVICE_RUN_NICE_LEVEL=0
3edf5e48 586
7742e157
AF
587 # And start it up.
588 busy
6b1fd029 589 cd $chdir
42595a81 590 [ -n "$SERVICE_CPUSET" ] && is_yes "$CPUSETS" && echo $$ > "/dev/cpuset/${SERVICE_CPUSET}/tasks"
18bd13ac 591 if errors=$(
f10f2102 592 umask ${SERVICE_UMASK:-$DEFAULT_SERVICE_UMASK};
739070c4 593 export USER=root HOME=/tmp TMPDIR=/tmp
f10f2102
ER
594 nice=${nice:-$DEFAULT_SERVICE_RUN_NICE_LEVEL}
595 nice=${nice:-0}
596
597 if [ "$closefds" = 1 ]; then
598 exec 1>&-
599 exec 2>&-
600 exec 0>&-
64c571c5
ER
601 elif [ "$redirfds" = 1 ]; then
602 exec 1>/dev/null
603 exec 2>/dev/null
604 exec 0>/dev/null
f10f2102
ER
605 else
606 exec 2>&1
607 fi
608
ac1f65e1 609 if is_no "$RC_LOGGING"; then
f10f2102
ER
610 prog=$1; shift
611 if [ ! -x $prog ]; then
612 logger -t rc-scripts -p daemon.debug "daemon: Searching PATH for $prog, consider using full path in initscript"
613 local a o=$IFS
614 IFS=:
615 for a in $PATH; do
616 if [ -x $a/$prog ]; then
617 prog=$a/$prog
618 break
619 fi
620 done
621 IFS=$o
622 fi
623 /sbin/start-stop-daemon -q --start \
624 --nicelevel $nice \
625 ${pidfile:+--pidfile $pidfile} \
86ed0b8f 626 ${makepid:+--make-pidfile} \
8a5b611f 627 ${user:+--chuid $user} \
6b1fd029 628 ${chdir:+--chdir "$chdir"} \
86ed0b8f
TP
629 ${fork:+--background} \
630 ${waitname:+--name $waitname} \
69bdc5ba 631 ${SERVICE_DROPCAPS:+--dropcap $SERVICE_DROPCAPS} \
f10f2102
ER
632 --exec "$prog" \
633 -- ${1:+"$@"}
634 else
635 nice -n $nice initlog -c "$prog" 2>&1
636 fi
18bd13ac 637 ); then
f10f2102 638
683d384e
AM
639 if [ -n "$waitname" -a -n "$waittime" ]; then
640 # Save basename.
03e01a49 641 base=${waitname##*/}
683d384e
AM
642 # Find pid.
643 pid=$(pidofproc "$waitname" "$pidfile")
644 [ -z "$pid" ] && pid=$(pidofproc "$base" "$pidfile")
645 i=0
646 while [ "$i" -lt "$waittime" ]; do
42595a81 647 i=$((i + 1))
683d384e
AM
648 checkpid $pid && sleep 1 || break
649 done
650 fi
d553f606 651 log_success "$1 startup"
1b228409 652 ok
7742e157 653 else
b7299ffc 654 exit_code=1
1b228409 655 fail
d553f606 656 log_failed "$1 startup"
4fbe82fd 657 [ -n "$errors" ] && echo >&2 "$errors"
7742e157 658 fi
b7299ffc 659 return $exit_code
7742e157
AF
660}
661
662# A function to stop a program.
18bd13ac 663killproc() {
944d6d80 664 local notset killlevel base pid pidfile result
7742e157
AF
665 # Test syntax.
666 if [ $# = 0 ]; then
3fa0b8fe 667 msg_usage " killproc [--pidfile PIDFILE] {program} [-SIGNAME]"
228edf1d 668 return 2
7742e157
AF
669 fi
670
bb49a1c7 671 while [ "$1" != "${1##-}" ]; do
8de7f381 672 case $1 in
739070c4 673 --pidfile)
53ae90e8 674 pidfile="$2"
5bf237b7 675 case "$pidfile" in /*);; *) pidfile="/var/run/$pidfile";; esac
53ae90e8 676 shift 2
8de7f381 677 ;;
739070c4 678 --waitforname)
53ae90e8
ER
679 waitname="$2"
680 shift 2
683d384e 681 ;;
739070c4 682 --waitfortime)
53ae90e8
ER
683 waittime="$2"
684 shift 2
683d384e 685 ;;
8de7f381
AM
686 esac
687 done
688
7742e157 689 busy
8a835e11 690
944d6d80 691 local notset=0
7742e157 692 # check for second arg to be kill level
ac1f65e1 693 if [ -n "$2" ]; then
7742e157
AF
694 killlevel=$2
695 else
696 notset=1
7742e157
AF
697 fi
698
2f269bdf
ER
699 # experimental start-stop-daemon based killing.
700 # works only with pidfile
701 if is_no "$RC_LOGGING" && [ "$pidfile" ]; then
5ec58ec2 702 local sig=${killlevel:--TERM}
2e00b711 703 /sbin/start-stop-daemon -q --stop \
2f269bdf
ER
704 --retry ${sig#-}/10/${sig#-}/60/KILL/10 \
705 -s ${sig#-} \
706 ${pidfile:+--pidfile $pidfile}
707 result=$?
708 if [ "$result" -eq 0 ]; then
709 ok
710 else
711 fail
712 fi
713 return $result
714 fi
715
716
228edf1d 717 # Save basename.
03e01a49 718 base=${1##*/}
7742e157 719
228edf1d 720 # Find pid.
8de7f381
AM
721 pid=$(pidofproc "$1" "$pidfile")
722 [ -z "$pid" ] && pid=$(pidofproc "$base" "$pidfile")
7742e157 723
228edf1d 724 # Kill it.
ac1f65e1
TP
725 if [ -n "$pid" -a "$pid" != "$$" ] && checkpid $pid 2>&1; then
726 if [ "$notset" = "1" ]; then
228edf1d 727 if checkpid $pid 2>&1; then
728 # TERM first, then KILL if not dead
729 kill -TERM $pid
730 usleep 100000
731 if checkpid $pid && sleep 1 &&
732 checkpid $pid && sleep 3 &&
733 checkpid $pid; then
53ae90e8
ER
734 # XXX: SIGKILL is sent already on 4th second!
735 # HARMFUL for example to mysqld (which is already workarounded)
228edf1d 736 kill -KILL $pid
737 usleep 100000
738 fi
7742e157 739 fi
228edf1d 740 checkpid $pid
bbb612de
AM
741 result=$?
742 if [ "$result" -eq 0 ]; then
228edf1d 743 fail
744 log_failed "$1 shutdown"
745 else
746 ok
747 log_success "$1 shutdown"
748 fi
749 result=$(( ! $result ))
750 else
751 # use specified level only
752 if checkpid $pid > /dev/null 2>&1; then
753 kill $killlevel $pid
754 result=$?
755 if [ "$result" -eq 0 ]; then
756 ok
757 log_success "$1 got $killlevel"
758 else
759 result=7
760 fail
761 log_failed "$1 didn't get $killlevel"
762 fi
e016cdae 763 else
228edf1d 764 result=7
765 died
766 log_failed "$1 shutdown"
e016cdae 767 fi
7742e157
AF
768 fi
769 else
228edf1d 770 died
771 log_failed "$1 shutdown"
772 result=7
7742e157 773 fi
5e6dfc29 774
683d384e 775 if [ -n "$waitname" -a -n "$waittime" ]; then
e6f93a80 776 # Save basename.
03e01a49 777 base=${waitname##*/}
e6f93a80
AM
778 # Find pid.
779 pid=$(pidofproc "$waitname" "$pidfile")
780 [ -z "$pid" ] && pid=$(pidofproc "$base" "$pidfile")
683d384e
AM
781 i=0
782 while [ "$i" -lt "$waittime" ]; do
1101d321 783 i=$(( i + 1 ))
683d384e
AM
784 checkpid $pid && sleep 1 || break
785 done
786 fi
7742e157 787
228edf1d 788 # Remove pid file if any.
e016cdae 789 if [ "$notset" = "1" ]; then
228edf1d 790 rm -f /var/run/${base}.pid
7742e157 791 fi
bbb612de
AM
792
793 return $result
7742e157
AF
794}
795
796# A function to find the pid of a program.
18bd13ac 797pidofproc() {
944d6d80 798 local pid pidfile base=${1##*/}
8de7f381
AM
799 pidfile="$base.pid"
800 [ -n "$2" ] && pidfile="$2"
7742e157 801
8a835e11 802 # Test syntax.
ac1f65e1 803 if [ $# = 0 ]; then
8a835e11 804 msg_usage " pidofproc {program}"
805 return 2
806 fi
807
8de7f381 808 # First try pidfile or "/var/run/*.pid"
5bf237b7
ER
809 case "$pidfile" in
810 /*)pidfile="${pidfile}";;
811 *) pidfile="/var/run/$pidfile";;
812 esac
ac1f65e1 813 if [ -f "${pidfile}" ]; then
944d6d80 814 local p pid=""
7eb94de6 815 for p in $(< "${pidfile}"); do
3030e60e 816 [ -z "$(echo "$p" | awk '{gsub(/[0-9]/,"");print;}')" ] && pid="$pid $p"
8a835e11 817 done
7742e157 818 fi
8a835e11 819
7742e157 820 # Next try "pidof"
1e5e8177
AM
821 [ -z "$pid" ] && pidof -o $$ -o $PPID -o %PPID -x "$1"
822 pid=$(filter_chroot "$pid")
823 echo $pid
7742e157 824}
12de71be 825
1b59b41b 826# status [--pidfile PIDFILE] {subsys} [{daemon}]"
18bd13ac 827status() {
944d6d80 828 local pid subsys daemon cpuset_msg pidfile
3232ec7b 829 if [ "$1" = "--pidfile" -o "$1" = "-p" ]; then
4e901aa0 830 pidfile=$2
5bf237b7 831 case "$pidfile" in /*);; *) pidfile="/var/run/$pidfile";; esac
4e901aa0
ER
832 shift 2
833 fi
834
8a835e11 835 subsys=$1
836 daemon=${2:-$subsys}
bbb612de 837
8a835e11 838 # Test syntax.
ac1f65e1 839 if [ $# = 0 ]; then
4e901aa0 840 msg_usage " status [--pidfile PIDFILE] {subsys} [{daemon}]"
8a835e11 841 return 2
842 fi
bbb612de 843
4e901aa0 844 # if pidfile specified, pid must be there
24ab860c
ER
845 if [ "$pidfile" ]; then
846 [ -f "$pidfile" ] && read pid < $pidfile
305c3281
ER
847 # filter_chroot does not filter out dead pids, so this extra check, see t/status-pidfile.sh
848 if [ ! -d "/proc/$pid" ]; then
849 pid=
850 fi
4e901aa0
ER
851 else
852 pid=$(pidof -o $$ -o $PPID -o %PPID -x $daemon)
853 fi
1e5e8177 854 pid=$(filter_chroot "$pid")
bbb612de 855
b90fbc1e 856 if [ "$pid" ]; then
814e38ce 857 cpuset_msg="..."
c51af89c
ER
858 if [ -n "$SERVICE_CPUSET" ] && is_yes "$CPUSETS"; then
859 if grep -q "$pid" "/dev/cpuset/${SERVICE_CPUSET}/tasks"; then
814e38ce
JR
860 cpuset_msg=$(nls " in cpuset %s..." "$SERVICE_CPUSET")
861 else
862 cpuset_msg=$(nls " outside of configured cpuset %s..." "$SERVICE_CPUSET")
863 fi
864 fi
865 nls "%s (pid %s) is running%s" "$daemon" "$pid" "$cpuset_msg"
8a835e11 866 return 0
8a835e11 867 fi
868
1b59b41b 869 # Next try "/var/run/*.pid" files; if pidfile is not set
4e901aa0 870 local base=${daemon##*/}
1b59b41b 871 if [ -z "$pidfile" -a -f /var/run/${base}.pid ]; then
8a835e11 872 read pid < /var/run/${base}.pid
1e5e8177 873 pid=$(filter_chroot "$pid")
1b59b41b
ER
874 if [ "$pid" ]; then
875 nls "%s dead but pid file (%s) exists" "$subsys" /var/run/${base}.pid
8a835e11 876 return 1
877 fi
878 fi
879
880 # See if /var/lock/subsys/$subsys exists
881 if [ -f /var/lock/subsys/$subsys ]; then
1b59b41b 882 nls "daemon %s dead but subsys (%s) locked" "$daemon" "$subsys"
8a835e11 883 return 2
7742e157 884 fi
8a835e11 885 nls "%s is stopped" "$subsys"
886 return 3
7742e157 887}
0524c81f 888
6b4a354c
AM
889# Confirm whether we really want to run this service
890confirm() {
944d6d80 891 local answer
d553f606 892 nls -n "Start service %s (Y)es/(N)o/(C)ontinue? [Y] " "$1"
6b4a354c
AM
893 read answer
894 case $answer in
739070c4 895 y|Y|t|T|j|J|"")
8a835e11 896 return 0
6b4a354c 897 ;;
739070c4 898 c|C|k|K|w|W)
8a835e11 899 return 2
6b4a354c 900 ;;
739070c4 901 n|N)
8a835e11 902 return 1
6b4a354c 903 ;;
739070c4 904 *)
8a835e11 905 confirm $1
906 return $?
6b4a354c
AM
907 ;;
908 esac
909}
910
d553f606 911# module is needed (ie. is requested, is available and isn't loaded already)
18bd13ac 912is_module() {
d553f606 913 # module name without .o at end
5778a670
ER
914 if ! lsmod | grep -q "$1"; then
915 if ls -R /lib/modules/$(uname -r)/ 2> /dev/null | grep -q "${1}.\(\|k\)o\(\|.gz\)"; then
d553f606
JR
916 # true
917 return 0
918 fi
919 fi
920 # false
921 return 1
0524c81f 922}
f7b2d235 923
18bd13ac 924_modprobe() {
944d6d80 925 local parsed single die args foo result
f7b2d235 926 parsed=no
ac1f65e1 927 while is_no "$parsed"; do
f7b2d235 928 case "$1" in
739070c4 929 "single")
8a835e11 930 single=yes
931 shift
932 ;;
739070c4 933 "die")
8a835e11 934 die=yes
935 shift
936 ;;
739070c4 937 -*)
8a835e11 938 args="$args $1"
939 shift
940 ;;
739070c4 941 *)
8a835e11 942 parsed=yes
943 ;;
f7b2d235
JR
944 esac
945 done
ac1f65e1 946 if is_yes "${single}"; then
f7b2d235
JR
947 foo="$@"
948 show "Loading %s kernel module(s)" "$foo"
f7b2d235
JR
949 busy
950 fi
ac1f65e1 951 if [ -x /sbin/modprobe ]; then
f7b2d235
JR
952 /sbin/modprobe -s $args "$@"
953 result=$?
954 else
ac1f65e1 955 deltext; fail
f7b2d235
JR
956 result=1
957 fi
ac1f65e1 958 if is_yes "${single}"; then
f7b2d235 959 deltext
ac1f65e1 960 if [ $result = "0" ]; then
d553f606 961 is_yes "$single" && ok
f7b2d235
JR
962 else
963 fail
ac1f65e1 964 if is_yes "$die"; then
f7b2d235
JR
965 nls "Could not load %s kernel module(s)" "$@"
966 exit 1
967 fi
968 fi
969 fi
f7b2d235 970}
d553f606 971
bc94aa53
ER
972if is_no "$RC_LOGGING"; then
973 log_success() {
974 :
975 }
d553f606 976
18bd13ac 977 log_failed() {
bc94aa53
ER
978 :
979 }
980else
18bd13ac 981 log_success() {
bc94aa53
ER
982 initlog -n $0 -s "$1 $2" -e 1
983 }
984
18bd13ac 985 log_failed() {
bc94aa53
ER
986 initlog -n $0 -s "$1 $2" -e 2
987 }
988fi
d553f606 989
f0c296a0
JR
990# Check if any flavor of portmapper is running
991check_portmapper() {
cbb91a00
ER
992 if [ -x /usr/sbin/rpcinfo ]; then
993 if /usr/sbin/rpcinfo -p localhost >/dev/null 2>/dev/null; then
fd8737b5 994 return 0
f0c296a0
JR
995 else
996 return 1
997 fi
5bf237b7
ER
998 elif [ -z "$(pidof portmap)" -a -z "$(pidof rpcbind)" ]; then
999 return 1
f0c296a0
JR
1000 fi
1001 return 0
1002}
1003
fab8c1a1
JR
1004# is_fsmounted fstype mntpoint
1005# Check if filesystem fstype is mounted on mntpoint
1006is_fsmounted() {
944d6d80
ER
1007 local fstype=$1
1008 local mntpoint=$2
fab8c1a1
JR
1009
1010 [ -n "$fstype" -a -n "$mntpoint" ] || return 1
1011
81ebaa15 1012 if [ -r /proc/mounts ]; then
bfd0227f 1013 grep -qE "[[:blank:]]$mntpoint[[:blank:]]+$fstype[[:blank:]]" /proc/mounts
81ebaa15 1014 return $?
fab8c1a1 1015 else
5bf237b7 1016 if [ "$(stat -L -f -c %T $mntpoint 2>/dev/null)" = "$fstype" ]; then
81ebaa15
JR
1017 return 0
1018 else
1019 return 1
1020 fi
fab8c1a1
JR
1021 fi
1022}
1023
0084dcf3 1024rc_cache_init() {
6e311c54
ER
1025 # If we have cachefile, use it.
1026 # If we don't, create memory variables and try to save silently,
acf05b4f 1027 local cachefile='/var/cache/rc-scripts/msg.cache'
0084dcf3 1028
4132441e
ER
1029 local term
1030 if is_yes "$ISATTY"; then
1031 term=$TERM
1032 else
1033 term=dumb
1034 fi
1035
0084dcf3
ER
1036 # We create $check variable which is used to invalidate the cache.
1037 # The $check contains user locale and terminal.
66f7cfac 1038 local check="$term.$LC_MESSAGES.$INIT_COL"
0084dcf3 1039
f9df72e7 1040 if [ -f "$cachefile" -a "$cachefile" -nt /etc/sysconfig/system -a "$cachefile" -nt /etc/sysconfig/init-colors ]; then
0084dcf3
ER
1041 if . "$cachefile" 2>/dev/null; then
1042 if [ "$check" = "$_check" ]; then
1043 return
1044 fi
1045 fi
f9df72e7
ER
1046 fi
1047
1048 # primitive caching
1049 _busy=$(progress "BUSY" "$CBUSY")
1050 _ok=$(progress "DONE")
1051 _started=$(progress "WORK")
1052 _fail=$(progress "FAIL" "$CFAIL")
1053 _died=$(progress "DIED" "$CFAIL")
cc54351b
ER
1054
1055 # we don't use heredoc, as ksh attempts to create tempfile then
3ba0bc12 1056 (> "$cachefile" ) 2>/dev/null || return
cc54351b
ER
1057 echo "_busy='$_busy';" >> "$cachefile"
1058 echo "_ok='$_ok';" >> "$cachefile"
1059 echo "_started='$_started';" >> "$cachefile"
1060 echo "_fail='$_fail';" >> "$cachefile"
1061 echo "_died='$_died';" >> "$cachefile"
1062 echo "_check='$check';" >> "$cachefile"
f9df72e7
ER
1063}
1064
0084dcf3 1065rc_gettext_init() {
9a0a016d
ER
1066 if [ -z "$GETTEXT" ]; then
1067 if [ -x /bin/gettext -o -x /usr/bin/gettext ]; then
1068 GETTEXT=yes
1069 else
1070 GETTEXT=no
1071 fi
1072 fi
1073
1074 if [ -z "$TPUT" ]; then
ac1f65e1 1075 if [ -d /usr/share/terminfo ] && [ -x /usr/bin/tput -o -x /bin/tput ]; then
9a0a016d
ER
1076 TPUT=yes
1077 # check if we are on proper terminal
1078 tput longname >/dev/null 2>&1 || TPUT=no
1079 else
1080 TPUT=no
1081 fi
1082 fi
1083}
1084
439b6d80
JK
1085use_upstart () {
1086 # True when upstart-event-based boot should be used
1087 is_yes "$USE_UPSTART" && return 0
1088 is_no "$USE_UPSTART" && return 1
1089 if [ ! -x /sbin/initctl ] ; then
1090 USE_UPSTART="no"
1091 return 1
1092 fi
13b36c6c 1093 local cmdline=$(cat /proc/cmdline 2>/dev/null)
439b6d80
JK
1094 if strstr "$cmdline" "pld.no-upstart" ; then
1095 USE_UPSTART="no"
1096 return 1
1097 else
1098 USE_UPSTART="yes"
1099 return 0
1100 fi
1101}
1102
1103emit () {
1104 # emit upstart signal
1105 # only when 'upstart' boot is enabled
1106 use_upstart || return 0
1107 /sbin/initctl emit "$@"
1108}
1109
9ee04f3b
JK
1110is_upstart_task() {
1111 # Return 0 if the given service is an upstart task.
1112 grep -q '^task' "/etc/init/$1.conf"
1113}
1114is_upstart_running() {
1115 # Return 0 if the given service is running via upstart
1116 initctl status "$1" 2>/dev/null | grep -q running
1117}
1118upstart_start() {
1119 local service=$1
1120 is_upstart_running "${service}" && return 0
1121 msg_starting "${service}"
1122 if errors=$(/sbin/initctl start ${service} 2>&1) ; then
1123 ok
439b6d80 1124 return 0
9ee04f3b
JK
1125 else
1126 fail
1127 echo "$errors" >&2
1128 return 1
1129 fi
1130}
1131upstart_stop() {
1132 local service=$1
1133 if ! is_upstart_running "${service}" && ! is_upstart_task "${service}" ; then
1134 return 0
1135 fi
1136 msg_stopping "${service}"
1137 if errors=$(/sbin/initctl stop ${service}) ; then
1138 ok
1139 return 0
1140 else
1141 fail
1142 echo "$errors" >&2
1143 return 1
1144 fi
1145}
1146upstart_reload() {
1147 local service=$1
1148 if ! is_upstart_running "${service}" && ! is_upstart_task "${service}" ; then
1149 return 0
1150 fi
1151 msg_reloading "${service}"
1152 if errors=$(/sbin/initctl reload ${service}) ; then
1153 ok
1154 return 0
1155 else
1156 fail
1157 echo "$errors" >&2
1158 return 1
1159 fi
1160}
1161upstart_status() {
1162 # get service status
1163 # should be compliant with
1164 # http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
1165 local service=$1
1166 local status
1167 if is_upstart_task "${service}" ; then
1168 # we probably should have a way to handle task status
439b6d80
JK
1169 return 0
1170 fi
9ee04f3b
JK
1171 if ! status=$(/sbin/initctl status "${service}") ; then
1172 # program or service status is not known
1173 return 4
1174 fi
1175 if strstr "$status" "running" ; then
1176 # program is running or service is OK
945d7cfd 1177 echo "$status"
9ee04f3b
JK
1178 return 0
1179 else
1180 # program is not running
945d7cfd 1181 echo "$status"
9ee04f3b
JK
1182 return 3
1183 fi
1184 # TODO: other statuses
1185}
1186
1187_upstart_controlled () {
1188 # If the service is to be handled by upstart
1189 # execute the start/stop/etc. commands the upstart way
1190 if ! use_upstart ; then
1191 return 0
1192 fi
1193 local script=$1
1194 shift
1195 local command=$1
1196 shift
9ee04f3b 1197 local name=$(basename "$script")
439b6d80
JK
1198 if [ ! -f /etc/init/${name}.conf ] ; then
1199 return 0
1200 fi
9b1f5468
JK
1201 local commands
1202 local extra_commands
02271277 1203 local has_configtest
9b1f5468
JK
1204 if [ "$1" = "--except" ] ; then
1205 shift
1206 commands="$*"
1207 for cmd in $commands ; do
1208 if [ "$command" = "$cmd" ] ; then
1209 return 0
1210 fi
1211 case "$cmd" in
1212 start|stop|status|reload|restart|try-restart|force-reload)
1213 ;;
02271277
JK
1214 configtest)
1215 has_configtest=yes
1216 extra_commands="|$cmd"
1217 ;;
9b1f5468
JK
1218 *)
1219 extra_commands="|$cmd"
1220 ;;
1221 esac
1222 done
1223 elif [ -n "$*" ] ; then
1224 commands="$*"
9ee04f3b
JK
1225 local cmd
1226 local found=0
1227 # is there a better way
1228 for cmd in $commands ; do
1229 if [ "$command" = "$cmd" ] ; then
1230 found=1
1231 break;
1232 fi
1233 done
1234 if [ $found = 0 ] ; then
1235 # let the script handle it
1236 return 0
1237 fi
1238 fi
439b6d80 1239 case "$command" in
9ee04f3b
JK
1240 start)
1241 upstart_start $name
1242 exit $?
1243 ;;
1244 stop)
1245 upstart_stop $name
1246 exit $?
1247 ;;
1248 status)
1249 upstart_status $name
1250 exit $?
1251 ;;
1252 restart)
023f83d5 1253 if is_yes "$has_configtest" ; then
02271277
JK
1254 "$script" configtest || exit 1
1255 fi
9ee04f3b
JK
1256 upstart_stop $name
1257 upstart_start $name
1258 exit $?
1259 ;;
d5a0dae5
JK
1260 try-restart)
1261 if ! is_upstart_running "$name" ; then
1262 exit 0
1263 fi
023f83d5 1264 if is_yes "$has_configtest" ; then
02271277
JK
1265 "$script" configtest || exit 1
1266 fi
d5a0dae5
JK
1267 upstart_stop $name
1268 upstart_start $name
1269 exit $?
1270 ;;
9ee04f3b 1271 reload)
023f83d5 1272 if is_yes "$has_configtest" ; then
02271277
JK
1273 "$script" configtest || exit 1
1274 fi
9ee04f3b
JK
1275 if is_upstart_task "$name" ; then
1276 nls "$command not implemented for $name"
1277 exit 3
1278 else
1279 upstart_reload "$name"
1280 exit $?
1281 fi
1282 ;;
1283 force-reload)
023f83d5 1284 if is_yes "$has_configtest" ; then
02271277
JK
1285 "$script" configtest || exit 1
1286 fi
9ee04f3b
JK
1287 if is_upstart_task "$name" ; then
1288 upstart_stop "$name"
1289 upstart_start "$name"
1290 exit $?
1291 else
1292 upstart_reload "$name"
1293 exit $?
1294 fi
439b6d80
JK
1295 ;;
1296 *)
9b1f5468 1297 msg_usage "$0 {start|stop|restart|reload|force-reload|status$extra_commands}"
9ee04f3b 1298 exit 3
439b6d80
JK
1299 ;;
1300 esac
9ee04f3b 1301 return 1 # should not happen
439b6d80 1302}
9ee04f3b
JK
1303
1304# Usage:
1305# somewhere at the begining of init script:
1306# upstart_controlled
1307# - to pass implement all upstart commands via initctl
1308# start, stop, status, restart, reload and force_reload
1309# are implemented
1310# upstart_controlled command...
1311# - to pass handle only specific commands the upstart way
1312# and leave the rest to the script
1313#
945d7cfd 1314alias upstart_controlled='_upstart_controlled $0 "$@"'
439b6d80 1315
0084dcf3
ER
1316rc_gettext_init
1317rc_cache_init
f9df72e7 1318
bbb612de
AM
1319#/*
1320# * Local variables:
1321# * mode: sh
1322# * indent-tabs-mode: notnil
1323# * End:
1324# *
bbb612de 1325# */
This page took 0.359153 seconds and 4 git commands to generate.