[ 
https://issues.apache.org/jira/browse/AMBARI-18824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15649147#comment-15649147
 ] 

Hudson commented on AMBARI-18824:
---------------------------------

SUCCESS: Integrated in Jenkins build Ambari-branch-2.5 #287 (See 
[https://builds.apache.org/job/Ambari-branch-2.5/287/])
AMBARI-18824 - MOTD Can Prevent WebHCat From Shutting Down (jhurley: 
[http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=1dd1f8476fc2615db8bb8d60bd970fbf61087a0a])
* (edit) ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py
* (edit) 
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/webhcat_service.py


> MOTD Can Prevent WebHCat From Shutting Down
> -------------------------------------------
>
>                 Key: AMBARI-18824
>                 URL: https://issues.apache.org/jira/browse/AMBARI-18824
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>    Affects Versions: 2.4.0
>            Reporter: Jonathan Hurley
>            Assignee: Jonathan Hurley
>            Priority: Blocker
>             Fix For: 2.4.2
>
>         Attachments: AMBARI-18824.patch
>
>
> There was code added in AMBARI-12695 (later corrected by AMBARI-18684) which 
> tries to kill WebHCat if it doesn't stop with its own stop command.
> Both patches use the {{as_user}} function to wrap the call in a bash login:
> {code}
> ps -p `su hcat -l -s /bin/bash -c 'cat /var/run/webhcat/webhcat.pid'` 
> >/dev/null 2>&1
> {code}
> This, however, causes problems where there is a MOTD:
> {code}
> ERROR: Process ID list syntax error.
> ********* simple selection *********  ********* selection by list *********
> -A all processes                      -C by command name
> -N negate selection                   -G by real group ID (supports names)
> -a all w/ tty except session leaders  -U by real user ID (supports names)
> -d all except session leaders         -g by session OR by effective group name
> -e all processes                      -p by process ID
>                                       -q by process ID (unsorted & quick)
> T  all processes on this terminal     -s processes in the sessions given
> a  all w/ tty, including other users  -t by tty
> g  OBSOLETE -- DO NOT USE             -u by effective user ID (supports names)
> r  only running processes             U  processes for specified users
> x  processes w/o controlling ttys     t  by tty
> *********** output format **********  *********** long options ***********
> -o,o user-defined  -f full            --Group --User --pid --cols --ppid
> -j,j job control   s  signal          --group --user --sid --rows --info
> -O,O preloaded -o  v  virtual memory  --cumulative --format --deselect
> -l,l long          u  user-oriented   --sort --tty --forest --version
> -F   extra full    X  registers       --heading --no-heading --context
>                                       --quick-pid
>                     ********* misc options *********
> -V,V  show version      L  list format codes  f  ASCII art forest
> -m,m,-L,-T,H  threads   S  children in sum    -y change -l format
> -M,Z  security data     c  true command name  -c scheduling class
> -w,w  wide output       n  numeric WCHAN,UID  -H process hierarchy
> {code}
> That's not good - why is it giving us back a bad command syntax? Here's the 
> reason:
> {code}
> [root@ijzs-c229todgsecha-r6-re1-3 ~]# su hcat -l -s /bin/bash -c 'cat 
> /var/run/webhcat/webhcat.pid'
> This is MOTD message :)
> 25672
> {code}
> *The MOTD is messing up the output from commands for the {{hcat}} user. 
> Because we rely on the error code of {{ps}}, the same non-zero code is used 
> for a bad command and a missing process ID*.
> Since the PID is world-readable, we don't need to run the {{only_if}} checks 
> as a separate user.



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

Reply via email to