You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by hf...@apache.org on 2017/04/01 04:17:47 UTC
[05/10] incubator-trafodion git commit: optimize ps command in
uninstall script
optimize ps command in uninstall script
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/6a65dcab
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/6a65dcab
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/6a65dcab
Branch: refs/heads/master
Commit: 6a65dcab0a8b045385c3147a89e873e7be6a465f
Parents: 71f0a62
Author: Eason <hf...@gmail.com>
Authored: Tue Mar 7 11:21:23 2017 +0800
Committer: Eason <hf...@gmail.com>
Committed: Fri Mar 31 15:41:12 2017 +0800
----------------------------------------------------------------------
install/python-installer/db_uninstall.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6a65dcab/install/python-installer/db_uninstall.py
----------------------------------------------------------------------
diff --git a/install/python-installer/db_uninstall.py b/install/python-installer/db_uninstall.py
index 5ab23e7..9372f34 100755
--- a/install/python-installer/db_uninstall.py
+++ b/install/python-installer/db_uninstall.py
@@ -101,8 +101,8 @@ def main():
# remove trafodion userid and group on all trafodion nodes, together with folders
for remote in remotes:
info('Remove Trafodion on node [%s] ...' % remote.host)
- remote.execute('ps -ef|grep ^%s|awk \'{print $2}\'|xargs sudo kill -9' % TRAF_USER, chkerr=False)
- remote.execute('ps -ef|grep krb5check|awk \'{print $2}\'|xargs sudo kill -9', chkerr=False) # traf kerberos service
+ remote.execute('ps -f -u %s|awk \'{print $2}\'|xargs sudo kill -9' % TRAF_USER, chkerr=False)
+ remote.execute('trafid=`getent passwd %s|awk -F: \'{print $3}\'`; if [[ -n $trafid ]]; then ps -f -u $trafid|awk \'{print $2}\'|xargs sudo kill -9; fi' % TRAF_USER, chkerr=False)
remote.execute('sudo -n /usr/sbin/userdel -rf %s' % TRAF_USER, chkerr=False)
remote.execute('sudo -n /usr/sbin/groupdel %s' % TRAF_USER, chkerr=False)
remote.execute('sudo -n rm -rf /etc/security/limits.d/%s.conf %s /tmp/hsperfdata_%s 2>/dev/null' % (TRAF_USER, TRAF_CFG_DIR, TRAF_USER), chkerr=False)