Use absolute path fpr ldmod; thanks to S. Blanchet.

This commit is contained in:
Florian Pose 2014-07-08 11:18:02 +02:00
parent bd048e8008
commit ef47dbbc44
2 changed files with 6 additions and 4 deletions

View File

@ -33,6 +33,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
LSMOD=/sbin/lsmod
MODPROBE=/sbin/modprobe MODPROBE=/sbin/modprobe
RMMOD=/sbin/rmmod RMMOD=/sbin/rmmod
MODINFO=/sbin/modinfo MODINFO=/sbin/modinfo
@ -109,7 +110,7 @@ start)
if [ ${MODULE} != "generic" ]; then if [ ${MODULE} != "generic" ]; then
# try to unload standard module # try to unload standard module
if lsmod | grep "^${MODULE} " > /dev/null; then if ${LSMOD} | grep "^${MODULE} " > /dev/null; then
if ! ${RMMOD} ${MODULE}; then if ! ${RMMOD} ${MODULE}; then
${RMMOD} ${LOADED_MODULES} ${RMMOD} ${LOADED_MODULES}
exit 1 exit 1
@ -137,7 +138,7 @@ stop)
# unload EtherCAT device modules # unload EtherCAT device modules
for MODULE in ${DEVICE_MODULES} master; do for MODULE in ${DEVICE_MODULES} master; do
ECMODULE=ec_${MODULE} ECMODULE=ec_${MODULE}
if ! lsmod | grep -q "^${ECMODULE} "; then if ! ${LSMOD} | grep -q "^${ECMODULE} "; then
continue # ec_* module not loaded continue # ec_* module not loaded
fi fi
if ! ${RMMOD} ${ECMODULE}; then if ! ${RMMOD} ${ECMODULE}; then

View File

@ -47,6 +47,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
LSMOD=/sbin/lsmod
MODPROBE=/sbin/modprobe MODPROBE=/sbin/modprobe
RMMOD=/sbin/rmmod RMMOD=/sbin/rmmod
MODINFO=/sbin/modinfo MODINFO=/sbin/modinfo
@ -177,7 +178,7 @@ start)
continue # ec_* module not found continue # ec_* module not found
fi fi
if [ ${MODULE} != "generic" ]; then if [ ${MODULE} != "generic" ]; then
if lsmod | grep "^${MODULE} " > /dev/null; then if ${LSMOD} | grep "^${MODULE} " > /dev/null; then
if ! ${RMMOD} ${MODULE}; then if ! ${RMMOD} ${MODULE}; then
exit_fail exit_fail
fi fi
@ -200,7 +201,7 @@ stop)
# unload EtherCAT device modules # unload EtherCAT device modules
for MODULE in ${DEVICE_MODULES} master; do for MODULE in ${DEVICE_MODULES} master; do
ECMODULE=ec_${MODULE} ECMODULE=ec_${MODULE}
if ! lsmod | grep -q "^${ECMODULE} "; then if ! ${LSMOD} | grep -q "^${ECMODULE} "; then
continue # ec_* module not loaded continue # ec_* module not loaded
fi fi
if ! ${RMMOD} ${ECMODULE}; then if ! ${RMMOD} ${ECMODULE}; then