开发者社区> 问答> 正文

greenplum默认环境是bash,如何改成zsh环境

chsh,修改系统默认shell为zsh之后,执行greenplum的命令会出现如下:

[FATAL]:-Scripts must be run by a user account that has SHELL=/bin/bash
[INFO]:-/bin/bash exists, please update user account shell

的错误提示,你说我该咋办呢,这种情况在postgresql都没有出现过。真是奇怪了,求大牛来解答一下,谢谢了!

展开
收起
jason张 2016-03-10 21:00:49 2688 0
2 条回答
写回答
取消 提交回答
  • 有些事确实挺操蛋的,

    我发现一个好的解决办法,不知道有什么潜在的危险,首先gp给出了gp用到的命令有python写的,有perl写的,还有一部分是bash写的
    如下:

    List of Management Scripts Written in Bash
    ------------------------------------------
    bin/gpcheckos.bash      -  Like gpcheckos, but in bash
    bin/gpcrondump          -  Dumps a database
    bin/gpdbrestore         -  Restores a database dumped from gpcrondump
    bin/gpinitsystem        -  Creates a new Greenplum Database
    bin/gpload              -  Sets env variables and calls gpload.py
    bin/gpprintdbsizes      -  Removed in 4.0
    bin/gprebuildsystem     -  Deprecated in 3.4

    通过以上命令提供的线索找到bin目录下的lib目录下的gp_bash_functions.sh,注释一下代码即可

    # Location Functions
    #******************************************************************************
    #Check that SHELL is /bin/bash
    #       if [ $SHELL != /bin/bash ] && [ `ls -al /bin/sh|grep -c bash` -ne 1 ];then
    #               echo "[FATAL]:-Scripts must be run by a user account that has SHELL=/bin/bash"
    #               if [ -f /bin/bash ];then
    #                       echo "[INFO]:-/bin/bash exists, please update user account shell"
    #               else
    #                       echo "[WARN]:-/bin/bash does not exist, does bash need to be installed?"
    #               fi
    #               exit 2
    #       fi
    
    2019-07-17 18:33:22
    赞同 展开评论 打赏
  • 公益是一辈子的事, I am digoal, just do it. 阿里云数据库团队, 擅长PolarDB, PostgreSQL, DuckDB, ADB等, 长期致力于推动开源数据库技术、生态在中国的发展与开源产业人才培养. 曾荣获阿里巴巴麒麟布道师称号、2018届OSCAR开源尖峰人物.

    gp有大量的管理脚本是bash的,你最好还是用bash来管理GP,或者修改一下已有的管理脚本,改成zsh兼容的。

    2019-07-17 18:33:22
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Shell 脚本速查手册 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载