summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2006-07-16 15:09:39 +0200
committerWilly Tarreau <willy@wtap.(none)>2006-07-26 11:59:36 +0200
commita616bab06c191ba8f9d304e3122e4efc2bd94492 (patch)
tree79584427fd8450871be8e98ec17af0afa64b84e3
parent[RELEASE] init-scripts-0.1 (diff)
downloadinit-scripts-a616bab06c191ba8f9d304e3122e4efc2bd94492.tar.gz
[RELEASE] init-scripts-0.2v0.2
-rw-r--r--ChangeLog4
-rwxr-xr-xsbin/init.d/functions16
-rwxr-xr-xsbin/init.d/system4
3 files changed, 15 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 4efaf74..a60f956 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2003/02/09:
+- on peut maintenant lancer des services même si la section n'existe pas dans
+ config.rc
+- sbin/init.d/system utilise désormais /proc pour positionner hostname et domainname.
2003/01/26: echelog
- lecture du fichier de configuration de echelog, déduction des sous fichiers
de configuration et des répertoires de spool
diff --git a/sbin/init.d/functions b/sbin/init.d/functions
index b154a43..88ebbfc 100755
--- a/sbin/init.d/functions
+++ b/sbin/init.d/functions
@@ -329,7 +329,7 @@ function do_stop_with_pidfile {
if [ $FORCE_START_STOP -eq 0 ]; then
if ! [ -r "$pidfile" ] || ! read pid REPLY <"$pidfile" || ! [ -L /proc/$pid/cwd ]; then
- echo "# Process $pname${instname:+[$instname]} already stopped (according to $pidfile)${pids:+, but check pids :$pids}"
+ echo "# Process $pname${instname:+[$instname]} already stopped (according to $pidfile)${pids:+, but check pids : $pids}"
return 0
fi
fi
@@ -461,7 +461,7 @@ function do_status_with_pidfile {
}
childrenpid $pid > /dev/null
local cpid=$*
- echo "Process $pname${instname:+[$instname]} running :$pid ${cpid:+($cpid)}"
+ echo "Process $pname${instname:+[$instname]} running : $pid ${cpid:+($cpid)}"
REPLY=$pid
return 0
}
@@ -481,7 +481,7 @@ function do_status {
# get info from pidof command
svc_pidof -o $$ $pname > /dev/null ; pids=$REPLY
- [ "$pids" ] && { echo "Process $pname${instname:+[$instname]} running without pidfile:$pids" ; return 0 ; }
+ [ "$pids" ] && { echo "Process $pname${instname:+[$instname]} running without pidfile : $pids" ; return 0 ; }
echo "Process $pname${instname:+[$instname]} stopped (no pidfile used)."
return 1
}
@@ -768,10 +768,12 @@ function load_config {
fi
if [ "$SVC_FOUND" != 1 -a "$MUST_LIST_SECTIONS" != 1 ]; then
- echo "Service/instance not found in $CONFIG"
- [ "x$G_FACILITY" != x ] && \
- logger -p $G_FACILITY.warn -t "flxi[$$].$PNAME" -- \
- "unknown[$USER]: $PNAME $ACTION ${SVC_INSTANCE[*]}"
+ echo "Service/instance not found in $CONFIG, using default values."
+ service $PNAME ; service ""
+
+ #[ "x$G_FACILITY" != x ] && \
+ # logger -p $G_FACILITY.warn -t "flxi[$$].$PNAME" -- \
+ # "unknown[$USER]: $PNAME $ACTION ${SVC_INSTANCE[*]}"
exit 1
fi
return $STATUS_RET
diff --git a/sbin/init.d/system b/sbin/init.d/system
index 11ebdde..46640b5 100755
--- a/sbin/init.d/system
+++ b/sbin/init.d/system
@@ -24,8 +24,8 @@ function do_start {
if [ "$opt_hostname" ] ; then
echo "Setting hostname '$opt_hostname'"
- hostname $opt_hostname
- domainname `echo $opt_hostname | cut -f2- -d.`
+ echo ${opt_hostname%%.*} >/proc/sys/kernel/hostname
+ echo ${opt_hostname#*.} >/proc/sys/kernel/domainname
fi
for arg in ${opt_sysctl[*]}; do