ambari-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sumit Mohanty (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AMBARI-18317) ambari-agent script does not check for unset variables. (Leading to chown root:root /)
Date Tue, 08 Nov 2016 01:52:58 GMT

     [ https://issues.apache.org/jira/browse/AMBARI-18317?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sumit Mohanty updated AMBARI-18317:
-----------------------------------
    Assignee: Andrew Onischuk

> 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)

Mime
View raw message