diff options
author | Bill Nottingham <notting@redhat.com> | 2002-04-10 06:08:16 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2002-04-10 06:08:16 +0000 |
commit | dcd626dd7e766e70fc4996c774e0f61489d71d87 (patch) | |
tree | 5531db585a6ac5a680c4495dcdda2262bcaae38c | |
parent | 2165a469e7c795b5af3759be00d698f02c7a1b3c (diff) | |
download | initscripts-dcd626dd7e766e70fc4996c774e0f61489d71d87.tar initscripts-dcd626dd7e766e70fc4996c774e0f61489d71d87.tar.gz initscripts-dcd626dd7e766e70fc4996c774e0f61489d71d87.tar.bz2 initscripts-dcd626dd7e766e70fc4996c774e0f61489d71d87.tar.xz initscripts-dcd626dd7e766e70fc4996c774e0f61489d71d87.zip |
change to root directory before staring/stopping; also sanitize environment (#53304, #61371)
-rwxr-xr-x | service | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -11,6 +11,7 @@ if [ $# -eq 0 ]; then exit 1 fi +cd / while [ $# -gt 0 ] do case "${1}" in @@ -32,7 +33,7 @@ do ;; *) if [ -x "${SERVICEDIR}/${SERVICE}" ]; then - "${SERVICEDIR}/${SERVICE}" status + env -i "${SERVICEDIR}/${SERVICE}" status fi ;; esac @@ -42,8 +43,8 @@ do SERVICE="${1}" cd "${SERVICEDIR}" if [ -x "${SERVICEDIR}/${SERVICE}" ]; then - "${SERVICEDIR}/${SERVICE}" stop - "${SERVICEDIR}/${SERVICE}" start + env -i "${SERVICEDIR}/${SERVICE}" stop + env -i "${SERVICEDIR}/${SERVICE}" start exit $? fi elif [ -z "${SERVICE}" ]; then @@ -57,7 +58,7 @@ do done if [ -x "${SERVICEDIR}/${SERVICE}" ]; then - "${SERVICEDIR}/${SERVICE}" ${OPTIONS} + env -i "${SERVICEDIR}/${SERVICE}" ${OPTIONS} else echo $"${SERVICE}: unrecognized service" >&2 exit 1 |