Menu

#496 pgxc_ctl sh: -c: line 0: syntax error near unexpected token `('

1.0 Dev Q
open
nobody
pgxc_ctl (5)
5
2017-03-14
2017-03-14
Adam S
No

pgxc_ctl init all
yields following error

Starting datanode master datanode2.
sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:(ssh postgres@192.168.1.15 touch (null)/gp05_STDOUT_4413_9) < /dev/null > /dev/null 2>&1'
sh: -c: line 0: syntax error near unexpected token null' sh: -c: line 0:(touch (null)/STDOUT_4413_8) < /dev/null > /dev/null'
sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:(scp postgres@192.168.1.15:(null)/gp05_STDOUT_4413_9 (null)/STDOUT_4413_8; ssh postgres@192.168.1.15 rm -rf (null)/gp05_STDOUT_4413_9) < /dev/null > /dev/null'
sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:(ssh postgres@192.168.1.16 touch (null)/gp05_STDOUT_4413_11) < /dev/null > /dev/null 2>&1'
ERROR: Cannot open "(null)/STDOUT_4413_8" for read, No such file or directory
sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:(rm -f (null)/STDOUT_4413_8) < /dev/null > /dev/null'
sh: -c: line 0: syntax error near unexpected token null' sh: -c: line 0:(touch (null)/STDOUT_4413_10) < /dev/null > /dev/null'
sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:(scp postgres@192.168.1.16:(null)/gp05_STDOUT_4413_11 (null)/STDOUT_4413_10; ssh postgres@192.168.1.16 rm -rf (null)/gp05_STDOUT_4413_11) < /dev/null > /dev/null'
ERROR: Cannot open "(null)/STDOUT_4413_10" for read, No such file or directory
sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:(rm -f (null)/STDOUT_4413_10) < /dev/null > /dev/null'
bash: -c: line 0: syntax error near unexpected token (' bash: -c: line 0:rm -f (null)/gp05_STDOUT_4413_9 > /dev/null 2>&1'
bash: -c: line 0: syntax error near unexpected token (' bash: -c: line 0:rm -f (null)/gp05_STDOUT_4413_11 > /dev/null 2>&1'
Done.
ERROR: could not open file (null)/STDIN_4413_12 for write, No such file or directory
Done.
Done.

On Scientific Linux release 6.8 (a rebuild of Enterprise Linux)
pg_ctl --version
pg_ctl (PostgreSQL) 9.5.5 (Postgres-XL 9.5r1.4)

bash --version
GNU bash, version 4.1.2(2)-release (x86_64-redhat-linux-gnu)

sh is symbolically linked to bash

Possible solution
Using the () to launch the command in a subshell as in (ssh postgres@192.168.1.15 touch (null)/gp05_STDOUT_4413_9), escape them using \ when bash is invoked via sh it runs in POSIX mode which is more strict

Related

Bugs: #496

Discussion

  • Koichi Suzuki

    Koichi Suzuki - 2017-03-15

    This is XL issue, not XC. You should post this to XL mailing list.


    Koichi Suzuki
    https://www.linkedin.com/in/koichidbms

    2017-03-15 8:10 GMT+09:00 Adam S acscott@users.sf.net:


    [bugs:#496] pgxc_ctl sh: -c: line 0: syntax error near unexpected token
    `('

    Status: open
    Group: 1.0 Dev Q
    Labels: pgxc_ctl
    Created: Tue Mar 14, 2017 11:10 PM UTC by Adam S
    Last Updated: Tue Mar 14, 2017 11:10 PM UTC
    Owner: nobody

    pgxc_ctl init all
    yields following error

    Starting datanode master datanode2.
    sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:(ssh postgres@192.168.1.15 touch
    (null)/gp05_STDOUT_4413_9) < /dev/null > /dev/null 2>&1'
    sh: -c: line 0: syntax error near unexpected token null' sh: -c: line 0:(touch (null)/STDOUT_4413_8) < /dev/null > /dev/null'
    sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:(scp postgres@192.168.1.15:(null)/gp05_STDOUT_4413_9
    (null)/STDOUT_4413_8; ssh postgres@192.168.1.15 rm -rf
    (null)/gp05_STDOUT_4413_9) < /dev/null > /dev/null'
    sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:(ssh postgres@192.168.1.16 touch
    (null)/gp05_STDOUT_4413_11) < /dev/null > /dev/null 2>&1'
    ERROR: Cannot open "(null)/STDOUT_4413_8" for read, No such file or
    directory
    sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:(rm -f (null)/STDOUT_4413_8) < /dev/null > /dev/null'
    sh: -c: line 0: syntax error near unexpected token null' sh: -c: line 0:(touch (null)/STDOUT_4413_10) < /dev/null > /dev/null'
    sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:(scp postgres@192.168.1.16:(null)/gp05_STDOUT_4413_11
    (null)/STDOUT_4413_10; ssh postgres@192.168.1.16 rm -rf
    (null)/gp05_STDOUT_4413_11) < /dev/null > /dev/null'
    ERROR: Cannot open "(null)/STDOUT_4413_10" for read, No such file or
    directory
    sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:(rm -f (null)/STDOUT_4413_10) < /dev/null > /dev/null'
    bash: -c: line 0: syntax error near unexpected token (' bash: -c: line 0:rm -f (null)/gp05_STDOUT_4413_9 > /dev/null 2>&1'
    bash: -c: line 0: syntax error near unexpected token (' bash: -c: line 0:rm -f (null)/gp05_STDOUT_4413_11 > /dev/null 2>&1'
    Done.
    ERROR: could not open file (null)/STDIN_4413_12 for write, No such file or
    directory
    Done.
    Done.

    On Scientific Linux release 6.8 (a rebuild of Enterprise Linux)
    pg_ctl --version
    pg_ctl (PostgreSQL) 9.5.5 (Postgres-XL 9.5r1.4)

    bash --version
    GNU bash, version 4.1.2(2)-release (x86_64-redhat-linux-gnu)

    sh is symbolically linked to bash

    Possible solution
    Using the () to launch the command in a subshell as in (ssh postgres@192.168.1.15 touch (null)/gp05_STDOUT_4413_9), escape them
    using \ when bash is invoked via sh it runs in POSIX mode which is more strict


    Sent from sourceforge.net because you indicated interest in <
    https://sourceforge.net/p/postgres-xc/bugs/496/>

    To unsubscribe from further messages, please visit <
    https://sourceforge.net/auth/subscriptions/>

     

    Related

    Bugs: #496

    • Adam S

      Adam S - 2017-03-15

      So it is. Thank you for your patience and letting me know. :)

       

Log in to post a comment.