Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App does not restart after exiting post update (LINUX) #22

Open
vinaynb opened this issue Sep 18, 2017 · 3 comments
Open

App does not restart after exiting post update (LINUX) #22

vinaynb opened this issue Sep 18, 2017 · 3 comments

Comments

@vinaynb
Copy link

vinaynb commented Sep 18, 2017

Hey @dsheiko hope you can help me out here.

Current OS - linux x64
I am currently following basic steps (swapping strategy)

cd example/server
npm i
npm start
cd ../client-strategy-script
npm i
npm package
cd /tmp/Sandbox
unzip ~/Sites/nw-autoupdater/example/server/releases/nw-autoupdater-demo-r1.0.0-osx-x64.zip -d .
cd -
npm version patch
cd -
open -a nw-autoupdater-demo.app

App downloads update successfully, backup folder is created successfully, current app exits but new one does not restart. I tried supplying a log file and checking for logs but there are no errors being reported there. I know that we open a background process via spawn to perform the swapping but i cannot figure out where to look for errors occurring in that spawned process (assuming there's some error in that process which prevents new app to start). Can you guide me as to where should i look for logs that may indicate why the restart fails ?

Also i cannot perform the update unless i start the application using sudo as without it app is unable to unzip the new version in /tmp folder because of insufficient permissions. I temporarily changed /tmp permissions to get around this.

Thanks for this project, appreciate your efforts !

@vinaynb
Copy link
Author

vinaynb commented Sep 18, 2017

This issue is similar to #21 except that i use nw-builder instead of nwjs-builder-phoenix.

@vinaynb
Copy link
Author

vinaynb commented Sep 18, 2017

Update:
I observed strange behaviour. When starting app with a certain version (say 1.0, 2.0 is available) there is a certain error window shown by nw.js which contains message "Your preferences could not be saved". If i don't close that window first before going ahead for downloading update, then the app does not restart successfully.

But if i do close that window before starting update progress, the new app with v 2.0 starts successfully and all happens as expected. Attaching the screenshot of window shown by nw.js

screenshot from 2017-09-18 19 59 46

@dsheiko do you have any idea what's going on because of that window and does it really affect the restart process ?

Also i have one more question - i have modified the shell script and put some echo statements just to debug. Below is my swap.sh in my project

#!/bin/bash
for i in "$@"
do
case $i in
  --app-path=*)
    APP_PATH="${i#*=}"
    shift
    ;;
  --bak-path=*)
    BAK_PATH="${i#*=}"
    shift
    ;;
  --update-path=*)
    UPDATE_PATH="${i#*=}"
    shift
    ;;
  --runner=*)
    RUNNER="${i#*=}"
    shift
    ;;
  --verbose=*)
    VERBOSE="${i#*=}"
    shift
    ;;
    *)
            # unknown option
    ;;
esac
done
echo "rsync -al${VERBOSE} --delete ${APP_PATH}/. ${BAK_PATH}/"
rsync -al${VERBOSE} --delete "${APP_PATH}/." "${BAK_PATH}/"
echo " "
echo "123"
echo "rsync -al${VERBOSE} --delete ${UPDATE_PATH}/. ${APP_PATH}/"
rsync -al${VERBOSE} --delete "${UPDATE_PATH}/." "${APP_PATH}/"
echo "456"

echo " "
echo "Hello world"
echo "$APP_PATH/${RUNNER}&"
"$APP_PATH/${RUNNER}"&
echo "Hello world ends"

I have custom logPath and the only log i see in there is echo of first rsync command. Nothing else. Even in cases of successful restart all i see is just one entry of that first rsync command. Is that normal ?

@Arti3DPlayer
Copy link

I have custom logPath and the only log i see in there is echo of first rsync command. Nothing else. Even in cases of successful restart all i see is just one entry of that first rsync command. Is that normal ?

the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants