[ https://issues.apache.org/jira/browse/AMBARI-18317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15668271#comment-15668271 ]
Jayush Luniya commented on AMBARI-18317: ---------------------------------------- Looks like this is already in 2.4. Resolving JIRA. commit ec16e4975f03294e2edacbd6884798c0cd5fdd23 Author: Andrew Onishuk <aonis...@hortonworks.com> Date: Mon Sep 19 19:37:21 2016 +0300 AMBARI-18360. ambari-agent check for unset variables (AMBARI-18317) (aonishuk) > ambari-agent script does not check for unset variables. (Leading to chown > root:root /) > -------------------------------------------------------------------------------------- > > 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 > Assignee: Andrew Onischuk > Fix For: 2.4.2 > > > 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)