Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

lisk.sh script is not able to stop a node #116

Closed
cezarsn opened this issue May 11, 2016 · 2 comments
Closed

lisk.sh script is not able to stop a node #116

cezarsn opened this issue May 11, 2016 · 2 comments
Assignees

Comments

@cezarsn
Copy link

cezarsn commented May 11, 2016

The lisk.sh script try do stop the process by invoking the "forever" binary. When the node is forked this process does not work anymore. and the forever command can not stop the application anymore. Because of this the rebuild option will not work anymore.

Maybe if the forever application is not able to stop the process and the pid is still available, in this case should the process be "kill"-ed and the databese stop..

Section 1

+ stop_lisk
+ forever stop lisk
+ '[' 1 '!=' 0 ']'
+ echo 'X Failed to stop lisk.'
X Failed to stop lisk.
+ sleep 1
+ start_postgresql
+ pg_ctl -D /opt/lisk/lisk-Linux-x86_64/pgsql/data -l /opt/lisk/lisk-Linux-x86_64/pgsql.log start
+ '[' 0 '!=' 0 ']'
+ sleep 1
+ rebuild_lisk
+ create_database
+ dropdb --if-exists lisk_test
+ createdb lisk_test
+ '[' 1 '!=' 0 ']'
+ echo 'X Failed to create postgres database.'
X Failed to create postgres database.
+ exit 1

Section 2

user@tudorsiilinca:/opt/lisk/lisk-Linux-x86_64$ ps aux | grep lisk
user  14218  0.0  1.2 170204 13204 ?        S    May10   0:01 /opt/lisk/lisk-Linux-x86_64/pgsql/bin/postgres -D /opt/lisk/lisk-Linux-x86_64/pgsql/data
user  14241  0.0  5.6 611596 57316 ?        Ss   May10   0:22 /opt/lisk/lisk-Linux-x86_64/bin/node /opt/lisk/lisk-Linux-x86_64/node_modules/forever/bin/monitor app.js
user  14242  6.9 24.5 1089888 250220 ?      Sl   May10  67:28 /opt/lisk/lisk-Linux-x86_64/bin/node /opt/lisk/lisk-Linux-x86_64/app.js
user  14247  0.3  7.1 174760 73088 ?        Ss   May10   3:06 postgres: user lisk_test 127.0.0.1(46326) idle
user  14248  0.3  7.4 179184 76116 ?        Ss   May10   3:05 postgres: user lisk_test 127.0.0.1(46327) idle
user  14249  0.3  7.0 175276 71712 ?        Ss   May10   3:07 postgres: user lisk_test 127.0.0.1(46328) idle
user  14250  0.3  7.2 178180 74240 ?        Ss   May10   3:05 postgres: user lisk_test 127.0.0.1(46330) idle
user  14251  0.3  7.1 174612 73192 ?        Ss   May10   3:04 postgres: user lisk_test 127.0.0.1(46331) idle
user  14254  0.3  7.2 178192 73900 ?        Ss   May10   3:02 postgres: user lisk_test 127.0.0.1(46345) idle
user  14255  0.3  6.6 172636 67780 ?        Ss   May10   3:01 postgres: user lisk_test 127.0.0.1(46346) idle
user  14509  0.1  6.0 174776 61992 ?        Ss   May10   0:57 postgres: user lisk_test 127.0.0.1(46459) idle
user  14510  0.1  6.3 178168 64304 ?        Ss   May10   0:58 postgres: user lisk_test 127.0.0.1(46460) idle
user  14511  0.1  6.3 178172 64828 ?        Ss   May10   0:58 postgres: user lisk_test 127.0.0.1(46461) idle
user  14512  0.1  6.0 175372 61628 ?        Ss   May10   0:57 postgres: user lisk_test 127.0.0.1(46465) idle
user  14513  0.1  6.4 178184 65260 ?        Ss   May10   0:59 postgres: user lisk_test 127.0.0.1(46466) idle
user  14514  0.1  6.0 174792 61140 ?        Ss   May10   0:59 postgres: user lisk_test 127.0.0.1(46467) idle
user  14515  0.1  5.9 174744 60948 ?        Ss   May10   0:59 postgres: user lisk_test 127.0.0.1(46468) idle
user  14516  0.1  6.0 174704 61296 ?        Ss   May10   0:59 postgres: user lisk_test 127.0.0.1(46469) idle
user  14517  0.1  6.0 174604 61080 ?        Ss   May10   0:58 postgres: user lisk_test 127.0.0.1(46470) idle
user  14518  0.1  6.3 178148 65112 ?        Ss   May10   0:57 postgres: user lisk_test 127.0.0.1(46471) idle
user  14722  0.0  5.9 174632 60820 ?        Ss   May10   0:56 postgres: user lisk_test 127.0.0.1(47930) idle
user  14723  0.1  5.9 174708 60836 ?        Ss   May10   0:58 postgres: user lisk_test 127.0.0.1(47931) idle
user  14724  0.0  6.3 178140 65008 ?        Ss   May10   0:56 postgres: user lisk_test 127.0.0.1(47932) idle
user  20132  0.0  0.0  11984   936 pts/0    S+   12:11   0:00 grep --color=auto lisk
@cezarsn
Copy link
Author

cezarsn commented May 11, 2016

maybe something like this;

stop_lisk() {
  forever stop lisk &> /dev/null
  if [ $? !=  0 ] && [ -f "$PID_FILE" ]; then
    local PID=$(cat "$PID_FILE")
  fi

  if [ ! -z "$PID" ]; then
        ps -p "$PID" > /dev/null 2>&1
     local STATUS=$?
  else
    local STATUS=1
  fi

  if [ -f $PID_FILE ] && [ ! -z "$PID" ] && [ $STATUS == 0 ]; then
    kill -9 "$PID" > /dev/null 2>&1
    echo "X Lisk has been killed."
  fi

  if [ $? !=  0 ] || [$STATUS ==1]; then
    echo "√ Lisk stopped successfully."
  fi

}

@karmacoma
Copy link
Contributor

Moved issue to lisk-build the home of lisk.sh: LiskArchive/lisk-build#10

shuse2 added a commit that referenced this issue Apr 10, 2019
…is-block-with-unkown-blockid

Blocks endpoint returns genesis block with unknown blockid - Closes #115
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants