You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Ryan Walder (JIRA)" <ji...@apache.org> on 2016/09/06 13:37:20 UTC

[jira] [Created] (AMBARI-18317) ambari-agent does not handle config valuse not existing

Ryan Walder created AMBARI-18317:
------------------------------------

             Summary: ambari-agent does not handle config valuse not existing
                 Key: AMBARI-18317
                 URL: https://issues.apache.org/jira/browse/AMBARI-18317
             Project: Ambari
          Issue Type: Bug
          Components: ambari-agent
    Affects Versions: 2.4.0
         Environment: Ubuntu 14.04
Hortonworks provided package: ambari-agent 4.2.0.1-1
            Reporter: Ryan Walder
             Fix For: 2.4.0


Using the following config (unchanged from a previous install, so missing options relevant to 2.4.0.1) with ambari-agent 2.4.0.1 causes the ambari-agent script to chown the entire filesystem as root.

{noformat}
[logging]
syslog_enabled=0

[agent]
ping_port=8670
data_cleanup_max_size_MB=100
prefix=/var/lib/ambari-agent/data
cache_dir=/var/lib/ambari-agent/cache
tolerate_download_failures=true
parallel_execution=0
data_cleanup_interval=86400
tolerate_download_failuresf=false
data_cleanup_max_age=2592000
loglevel=INFO
run_as_user=root

[server]
secured_url_port=8441
hostname=cs-vagrant-hadoop-ambarimaster-01.gel.zone
url_port=8440

[services]
pidLookupPath=/var/run/

[heartbeat]
dirs=/etc/hadoop,/etc/hadoop/conf,/etc/hbase,/etc/hcatalog,/etc/hive,/etc/oozie,/etc/sqoop,/etc/ganglia,/var/run/hadoop,/var/run/zookeeper,/var/run/hbase,/var/run/templeton,/var/run/oozie,/var/log/hadoop,/var/log/zookeeper,/var/log/hbase,/var/run/templeton,/var/log/hive
log_lines_count=300
state_interval=6

[security]
server_crt=ca.crt
keysdir=/var/lib/ambari-agent/keys
passphrase_env_var_name=AMBARI_PASSPHRASE
ryanwalder@ryanwlaptop:~$ vi old 
ryanwalder@ryanwlaptop:~$ vi old 
ryanwalder@ryanwlaptop:~$ vi old 
ryanwalder@ryanwlaptop:~$ cat old 
[logging]
syslog_enabled=0

[agent]
ping_port=8670
data_cleanup_max_size_MB=100
prefix=/var/lib/ambari-agent/data
cache_dir=/var/lib/ambari-agent/cache
tolerate_download_failures=true
parallel_execution=0
data_cleanup_interval=86400
tolerate_download_failuresf=false
data_cleanup_max_age=2592000
loglevel=INFO
run_as_user=root

[server]
secured_url_port=8441
hostname=cs-vagrant-hadoop-ambarimaster-01.gel.zone
url_port=8440

[services]
pidLookupPath=/var/run/

[heartbeat]
dirs=/etc/hadoop,/etc/hadoop/conf,/etc/hbase,/etc/hcatalog,/etc/hive,/etc/oozie,/etc/sqoop,/etc/ganglia,/var/run/hadoop,/var/run/zookeeper,/var/run/hbase,/var/run/templeton,/var/run/oozie,/var/log/hadoop,/var/log/zookeeper,/var/log/hbase,/var/run/templeton,/var/log/hive
log_lines_count=300
state_interval=6

[security]
server_crt=ca.crt
keysdir=/var/lib/ambari-agent/keys
passphrase_env_var_name=AMBARI_PASSPHRASE
{noformat}

It looks like the following lines are to blame

{noformat}
        ambari-sudo.sh chown -R $current_user "$AMBARI_PID_DIR/"
        ambari-sudo.sh mkdir -p "$AMBARI_AGENT_LOG_DIR"
        ambari-sudo.sh chown -R $current_user:$current_group "$AMBARI_AGENT_LOG_DIR/"
{noformat}

No checking for unset variables in 2016? Top notch.

http://www.davidpashley.com/articles/writing-robust-shell-scripts/



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)