sh: error importing function definition for BASH_FUNC_module EBS12.2
Error:-
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `BASH_FUNC_module’
Reference:-R12.2 Errors Running adadminsrvctl.sh with ‘sh: module: line 1: Syntax Error: Unexpected End Of File’ or
‘Importing Function Definition for `BASH_FUNC_module” On Oracle Linux 6 64-bit (Doc ID 1595052.1)
Before:-
You are running adadminsrvctl.sh version 120.10.12020000.2
Starting WLS Admin Server…
Refer /u01/applmgr/PROD/fs1/inst/apps/PROD_hari/logs/appl/admin/log/adadminsrvctl.txt for details
adadminsrvctl.sh: exiting with status 0
adadminsrvctl.sh: check the logfile /u01/applmgr/PROD/fs1/inst/apps/PROD_hari/logs/appl/admin/log/adadminsrvctl.txt for more information …
.end std out.
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `BASH_FUNC_module’
.end err out.
This is related to OS level profiles setup referencing modules.sh.
This issue may occur when doing any of the following:
1. Attempting to start the Admin Server:
$ sh adadminsrvctl.sh start
2. Running either adop prepare o apply phases:
$ adop phase=prepare or adop phase=apply
SOLUTION
To implement the solution, test the following steps in a development instance and migrate accordingly:
1. Please rename the /etc/profile.d/modules.sh to /etc/profile.d/modules.sh.bkup h.
Connect as root:
# mv /etc/profile.d/modules.sh /etc/profile.d/modules.sh.bkup
[root@hari ~]# ls -lrt /etc/profile.d/modules.sh
-rw-rw-r–. 1 root root 168 Mar 21 2016 /etc/profile.d/modules.sh
[root@hari ~]# mv /etc/profile.d/modules.sh /etc/profile.d/modules.sh.bkup
[root@hari ~]# ls -lrt /etc/profile.d/modules.sh
ls: cannot access /etc/profile.d/modules.sh: No such file or directory
2. Run ./adadminsrvctl.sh start to test whether the issue is resolved.