Bug #10904
closed/etc/init.d/rudder-agent: 1: export: jdk-amd64: bad variable name on a debian jessie 8 docker
Description
Hi,
i try to install Rudder agent on a debian docker. I have thos error when i try to start the agent.
cat /etc/os-release¶
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
systemctl status rudder-agent.service -l
@rudder-agent.service - LSB: CFEngine Community
Loaded: loaded (/etc/init.d/rudder-agent)
Active: failed (Result: exit-code) since Tue 2017-06-13 14:43:41 UTC; 8s ago
Process: 13306 ExecStart=/etc/init.d/rudder-agent start (code=exited, status=2)
Jun 13 14:43:41 XXXXXXXXXXXXXXXXXXXXXX rudder-agent13306: export MANPATH='/usr/local/man:/usr/local/share/man:/usr/share/man:/opt/rudder/share/man'
Jun 13 14:43:41 XXXXXXXXXXXXXXXXXXXXXX [13306]: export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/rudder/cfengine-community/bin'
Jun 13 14:43:41 XXXXXXXXXXXXXXXXXXXXXX rudder-agent13306: export PWD='/'
Jun 13 14:43:41 XXXXXXXXXXXXXXXXXXXXXX rudder-agent13306: /etc/init.d/rudder-agent: 1: export: jdk-amd64: bad variable name@
apt-cache show rudder-agent¶
Package: rudder-agent
Priority: extra
Section: admin
Installed-Size: 85449
Maintainer: Rudder packaging team <rudder-packaging@rudder-project.org>
Architecture: amd64
Version: 4.1.3-jessie0
Replaces: rudder-cfengine-community, rudder-server-root (<< 2.4.0~beta2)
Provides: rudder-agent, rudder-cfengine-community
Depends: libc6 (>= 2.14), libpam0g (>= 0.99.7.1), libpcre3 (>= 1:8.35), libssl1.0.0 (>= 1.0.0), uuid-runtime, dmidecode, cron, net-tools, openssl
Conflicts: rudder-agent-thin, rudder-cfengine-community
Breaks: rudder-server-root (<< 2.4.0~beta2)
Filename: pool/main/r/rudder-agent/rudder-agent_4.1.3-jessie0_amd64.deb
Size: 14122288
MD5sum: 8dbe45d763c1b1554b81b996dd5ef133
SHA1: b8f74d65aacc231447ab944ab27a0827fad3a7df
SHA256: d0898745450e233d5b0ea8ecdc8504d74dd65e89633b0e23ace3a5fbf0639e26
SHA512: 88802b532025df328e7032043436b7ec28fa0c306a20b89e0e523ede385650d6912606c6688ed0ceadda712a4fddf13ed2ecbfcdc583fef7980912650bad78f8
Description: Configuration management and audit tool - agent
Rudder is an open source configuration management and audit solution.
.
This package contains the agent that must be installed on all nodes to be
managed by Rudder. It is based on two main components: CFEngine Community 3 and
FusionInventory.
Description-md5: 09d43451ce1780eefda6ce7ec6383afa
Homepage: http://www.rudder-project.org
have a good day !
Updated by Benoît PECCATTE over 7 years ago
This is weird, I see no "export PWD" nor "export jdk-amd64" nor "export $something" in the source code. Moreover the agent doesn't use java.
Couldn't it be a problem in your /etc/profile since it is loaded by the agent.
You could try putting "set -x" at the beginning of the init file to check where exactly the error comes from.
Updated by Janos Mattyasovszky over 7 years ago
Since it's in the syslog, I suspect the message
function is misbehaving and logging something it should not?
Was maybe the function name redefined from something else?
Updated by pierrick prost over 7 years ago
Hi, sorry for the delay. Where i need to put the "set -x" config ?
Benoît PECCATTE wrote:
This is weird, I see no "export PWD" nor "export jdk-amd64" nor "export $something" in the source code. Moreover the agent doesn't use java.
Couldn't it be a problem in your /etc/profile since it is loaded by the agent.
You could try putting "set -x" at the beginning of the init file to check where exactly the error comes from.
Updated by Benoît PECCATTE over 7 years ago
At the beginning after the shebang.
For example as the second line of the script.
Updated by pierrick prost over 7 years ago
Hi,
For your information, we have a JIRA from atlassian with a tomcat.
Here is my /etc/profile :
++ id -u + '[' 0 -eq 0 ']' + PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + export PATH + '[' '\s-\v\$ ' ']' + '[' /bin/bash ']' + '[' /bin/bash '!=' /bin/sh ']' + '[' -f /etc/bash.bashrc ']' + . /etc/bash.bashrc ++ '[' -z '\s-\v\$ ' ']' ++ shopt -s checkwinsize ++ '[' -z '' ']' ++ '[' -r /etc/debian_chroot ']' ++ PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' ++ '[' -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ']' + '[' -d /etc/profile.d ']' + for i in '/etc/profile.d/*.sh' + '[' -r /etc/profile.d/rudder-agent.sh ']' + . /etc/profile.d/rudder-agent.sh ++ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/rudder/cfengine-community/bin ++ export PATH ++ type manpath +++ manpath ++ MANPATH=/usr/local/man:/usr/local/share/man:/usr/share/man:/opt/rudder/share/man ++ export MANPATH + unset i + OLD_IFS=' ' + IFS=' ' ++ cat /.jelenv + for env in '$(cat /.jelenv)' ++ echo JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"' ++ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ++ JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 + for env in '$(cat /.jelenv)' ++ echo JAVA_DEBIAN_VERSION=8u111-b14-2~bpo8+1 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export JAVA_DEBIAN_VERSION="8u111-b14-2~bpo8+1"' ++ export JAVA_DEBIAN_VERSION=8u111-b14-2~bpo8+1 ++ JAVA_DEBIAN_VERSION=8u111-b14-2~bpo8+1 + for env in '$(cat /.jelenv)' ++ echo CA_CERTIFICATES_JAVA_VERSION=20140324 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export CA_CERTIFICATES_JAVA_VERSION="20140324"' ++ export CA_CERTIFICATES_JAVA_VERSION=20140324 ++ CA_CERTIFICATES_JAVA_VERSION=20140324 + for env in '$(cat /.jelenv)' ++ echo JIRA_HOME=/var/atlassian/jira ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export JIRA_HOME="/var/atlassian/jira"' ++ export JIRA_HOME=/var/atlassian/jira ++ JIRA_HOME=/var/atlassian/jira + for env in '$(cat /.jelenv)' ++ echo PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"' ++ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ++ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + for env in '$(cat /.jelenv)' ++ echo DOCKER_EXPOSED_PORT=8080 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export DOCKER_EXPOSED_PORT="8080"' ++ export DOCKER_EXPOSED_PORT=8080 ++ DOCKER_EXPOSED_PORT=8080 + for env in '$(cat /.jelenv)' ++ echo APP_VERSION=3.4.1 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export APP_VERSION="3.4.1"' ++ export APP_VERSION=3.4.1 ++ APP_VERSION=3.4.1 + for env in '$(cat /.jelenv)' ++ echo JAVA_VERSION=8u111 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export JAVA_VERSION="8u111"' ++ export JAVA_VERSION=8u111 ++ JAVA_VERSION=8u111 + for env in '$(cat /.jelenv)' ++ echo LANG=C.UTF-8 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export LANG="C.UTF-8"' ++ export LANG=C.UTF-8 ++ LANG=C.UTF-8 + for env in '$(cat /.jelenv)' ++ echo JIRA_INSTALL=/opt/atlassian/jira ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export JIRA_INSTALL="/opt/atlassian/jira"' ++ export JIRA_INSTALL=/opt/atlassian/jira ++ JIRA_INSTALL=/opt/atlassian/jira ++ cat /.jelenv + for env in '$(cat /.jelenv)' ++ echo JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"' ++ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ++ JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 + for env in '$(cat /.jelenv)' ++ echo JAVA_DEBIAN_VERSION=8u111-b14-2~bpo8+1 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export JAVA_DEBIAN_VERSION="8u111-b14-2~bpo8+1"' ++ export JAVA_DEBIAN_VERSION=8u111-b14-2~bpo8+1 ++ JAVA_DEBIAN_VERSION=8u111-b14-2~bpo8+1 + for env in '$(cat /.jelenv)' ++ echo CA_CERTIFICATES_JAVA_VERSION=20140324 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export CA_CERTIFICATES_JAVA_VERSION="20140324"' ++ export CA_CERTIFICATES_JAVA_VERSION=20140324 ++ CA_CERTIFICATES_JAVA_VERSION=20140324 + for env in '$(cat /.jelenv)' ++ echo JIRA_HOME=/var/atlassian/jira ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export JIRA_HOME="/var/atlassian/jira"' ++ export JIRA_HOME=/var/atlassian/jira ++ JIRA_HOME=/var/atlassian/jira + for env in '$(cat /.jelenv)' ++ echo PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"' ++ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ++ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + for env in '$(cat /.jelenv)' ++ echo DOCKER_EXPOSED_PORT=8080 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export DOCKER_EXPOSED_PORT="8080"' ++ export DOCKER_EXPOSED_PORT=8080 ++ DOCKER_EXPOSED_PORT=8080 + for env in '$(cat /.jelenv)' ++ echo APP_VERSION=3.4.1 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export APP_VERSION="3.4.1"' ++ export APP_VERSION=3.4.1 ++ APP_VERSION=3.4.1 + for env in '$(cat /.jelenv)' ++ echo JAVA_VERSION=8u111 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export JAVA_VERSION="8u111"' ++ export JAVA_VERSION=8u111 ++ JAVA_VERSION=8u111 + for env in '$(cat /.jelenv)' ++ echo LANG=C.UTF-8 ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export LANG="C.UTF-8"' ++ export LANG=C.UTF-8 ++ LANG=C.UTF-8 + for env in '$(cat /.jelenv)' ++ echo JIRA_INSTALL=/opt/atlassian/jira ++ sed -rne 's/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p' + eval 'export JIRA_INSTALL="/opt/atlassian/jira"' ++ export JIRA_INSTALL=/opt/atlassian/jira ++ JIRA_INSTALL=/opt/atlassian/jira + IFS=' ' + '[' /bin/bash ']' + '[' -f /root/.bashrc ']' + . /root/.bashrc + mesg n
$ service rudder-agent restart Job for rudder-agent.service failed. See 'systemctl status rudder-agent.service' and 'journalctl -xn' for details. root@node3383-env-8415454:~# journalctl -xn
$ journalctl -xn -- Logs begin at Tue 2017-06-13 16:08:18 UTC, end at Thu 2017-06-15 12:39:06 UTC. -- Jun 15 12:39:06 XXXXXXXXXXXXXXXXXXXXXX rudder-agent[29443]: JAVA_DEBIAN_VERSION=8u111-b14-2~bpo8+1 Jun 15 12:39:06 XXXXXXXXXXXXXXXXXXXXXX rudder-agent[29443]: CA_CERTIFICATES_JAVA_VERSION=20140324 Jun 15 12:39:06 XXXXXXXXXXXXXXXXXXXXXX rudder-agent[29443]: JIRA_HOME=/var/atlassia Jun 15 12:39:06 XXXXXXXXXXXXXXXXXXXXXX rudder-agent[29443]: + sed -rne s/"/\\"/g;s/([^=]+)=(.*)/\1="\2"/;p Jun 15 12:39:06 XXXXXXXXXXXXXXXXXXXXXX rudder-agent[29443]: + eval export jdk-amd64 Jun 15 12:39:06 XXXXXXXXXXXXXXXXXXXXXX rudder-agent[29443]: JAVA_DEBIAN_VERSION="8u111-b14-2~bpo8+1" Jun 15 12:39:06 XXXXXXXXXXXXXXXXXXXXXX rudder-agent[29443]: CA_CERTIFICATES_JAVA_VERSION="20140324" Jun 15 12:39:06 XXXXXXXXXXXXXXXXXXXXXX rudder-agent[29443]: JIRA_HOME="/var/atlassia" Jun 15 12:39:06 XXXXXXXXXXXXXXXXXXXXXX rudder-agent[29443]: + export jdk-amd64 Jun 15 12:39:06 XXXXXXXXXXXXXXXXXXXXXX rudder-agent[29443]: /etc/init.d/rudder-agent: 1: export: jdk-amd64: bad variable name
Have a good day.
Updated by Benoît PECCATTE over 7 years ago
It seems that you have typed set -x in the command line.
I was suggesting putting it in the /etc/init.d/rudder-agent script so that we would have the detail of its execution in the logs.
Updated by pierrick prost over 7 years ago
Hi, ok sorry.
there is :
service rudder-agent restart
+ service rudder-agent restart
Warning: Unit file of rudder-agent.service changed on disk, 'systemctl daemon -reload' recommended.
Job for rudder-agent.service failed. See 'systemctl status rudder-agent.servi ce' and 'journalctl -xn' for details.
Updated by Benoît PECCATTE over 7 years ago
And does the journalctl -xn output contain the script execution content ?
Updated by Benoît PECCATTE over 7 years ago
Hello Pierrick, did you have time to get the log output ?
Updated by pierrick prost over 7 years ago
hello, sorry for the delay.
Explain me what dou you whant and i'll do the export.
regards.
Updated by Benoît PECCATTE over 7 years ago
- add set -x at the beginning of /etc/init.d/rudder-agent
- restart rudder agent
- check the output of journalctl -xn to have the detail of where the problem hapens
Updated by Benoît PECCATTE over 7 years ago
Hello Pierrick.
Do you still have a problem with this?
Updated by Benoît PECCATTE about 7 years ago
- Status changed from New to Rejected
Rejecting as nor reproducible.
Feel free to reopen if needed