Kettle reported an error ldconfig: command not found solution

I. Introduction

It was normal for the test server to have a kettle before; after changing the server and migrating the kettle, the problem was discovered.

1. Manually execute the following command to run kettle:

LOG_DATE=`date +%Y%m%d`
LOG_PATH=/home/admin/kettle/logs/mykettle_${LOG_DATE}.log
KJB_PATH=/home/admin/kettle/kjb
/home/admin/kettle/data-integration/kitchen.sh -file=${KJB_PATH}/mykettle_.kjb  >>${LOG_PATH} 2>&1

2. However, using crontabthe kettle

*/1 * * * * /home/admin/kettle/shell/mykettle.sh >> /home/admin/kettle/logs/cron.log 2>&1

It will report an error:

/home/admin/kettle/data-integration/spoon.sh: line 118: ldconfig: command not found
#######################################################################
WARNING:  no libwebkitgtk-1.0 detected, some features will be unavailable
    Consider installing the package with apt-get or yum.
    e.g. 'sudo apt-get install libwebkitgtk-1.0-0'
#######################################################################
/home/admin/kettle/data-integration/spoon.sh: line 227: java: command not found

2. The investigation process

1. Baidu searched no libwebkitgtk-1.0 detected, some features will be unavailableand found that there are quite a lot of related kettle tutorials, which means that a webkitgtk-2.4.9-1.el7.x86_64.rpmpackage needs to be installed.

The package can be downloaded from this website:

http://www.rpmfind.net/linux/rpm2html/search.php?query=libicui18n&submit=Search+...&system=&arch=

2. However, after installation, crontaban error is still reported when using kettle.

/home/admin/kettle/data-integration/spoon.sh: line 118: ldconfig: command not found
#######################################################################
WARNING:  no libwebkitgtk-1.0 detected, some features will be unavailable
    Consider installing the package with apt-get or yum.
    e.g. 'sudo apt-get install libwebkitgtk-1.0-0'
#######################################################################
/home/admin/kettle/data-integration/spoon.sh: line 227: java: command not found

3. Solutions

1. I searched a lot on the Internet, but did not find a solution.

2. The analysis found that the problem should be that spoon.sh: line 118: ldconfig: command not foundcrontab failed to execute ldconfig. (Manual execution of kettle can be successful, so it should not be a problem of lack of libwebkitgtk-1.0 package)

3. Configure the command test in crontab: */1 * * * * ldconfig -p >> /home/admin/abc.log 2>&1, and find that the error message will also be printed:

/bin/sh: ldconfig: command not found

At this point, it is determined that it is the problem of crontabexecuting ldconfigthe error report (the follow-up spoon.sh: line 227: java: command not foundalso shows that the execution of the java command reports an error), rather than the lack of libwebkitgtk-1.0 package.

4. Feedback the problem to the person in charge of the server, they changed some environment variables (said they added sbin and the like, but they didn't understand what was changed).

5. Then, add the following code to the top of spoon.sh (to refresh the environment variables):

#!/bin/sh
. /etc/profile
. ~/.bash_profile

Re-testing found that crontab executed kettle successfully.

4. Remarks

1. The problem this time is not the lack of libwebkitgtk-1.0 package, but the problem that crontab will report errors when executing ldconfig and java commands.

2. You can add the command to refresh the environment variables at the top of spoon.sh to see if it can solve the problem.

3. If not, it depends on whether the environment variable configuration is correct (it is not clear which environment variables need to be checked, it should be searchable crontab执行ldconfig报错, and it has something to do with the path sbin?)

Guess you like

Origin blog.csdn.net/BHSZZY/article/details/132026734