NotepadNext icon indicating copy to clipboard operation
NotepadNext copied to clipboard

System shutdown or SIGKILL will lose session data

Open dail8859 opened this issue 2 years ago • 5 comments

If you kill the app with SIGKILL signal it will always loose all the state. That's the tl;dr info.

Example how do I reproduce it:

  1. Open NN
  2. In the terminal do: top -b -n 1 | grep wrap and remember the pid (first number)
  3. In the terminal do: kill -9 INPUT_PID_HERE
  4. You should be able to replace step 2 & 3 with killall -9 AppRun.wrapped, but it seems that process name of NN is kind of generic and that could kill some other apps as well if you happen to run one with the same process name.

Originally posted by @dzek69 in https://github.com/dail8859/NotepadNext/issues/81#issuecomment-1381741141

dail8859 avatar Jan 13 '23 12:01 dail8859

I cannot reproduce this on Linux. I opened a session - and then killall -9 NotepadNext - when I re-open the app, the files are all OK (even the unsaved buffers).

diegoiast avatar Feb 10 '23 16:02 diegoiast

@elcuco how do you run the app? on which distro? I'm on Linux Mint and when running appImage I don't have a process named NotepadNext therefore killall -9 NotepadNext just returns NotepadNext: no process found and Notepad continues to run

dzek69 avatar Feb 17 '23 17:02 dzek69

(sorry for late response)

Running the AppImage is broken here (Debian Testing, both Qt5 and Qt6 versions as pulled from a latest action run, which is another issue). So, I am unable to do the same test as you.

However - am running the process directly on Linux (from QtCreator, from the cmake branch to be precise) - and I cannot reproduce what you describe.

diegoiast avatar Mar 04 '23 20:03 diegoiast

it must be something with the AppImage wrapper then

dzek69 avatar Mar 04 '23 20:03 dzek69

To verify run: APPIMAGE_EXTRACT_AND_RUN=1 NO_CLEANUP=1 ./NotepadNext-x86_64.AppImage

Then look inside /tmp for your extracted image... and start digging into shell scripts:

diego@debian:/tmp/appimage_extracted_02dad8f10b1e395ca6df23ef954e0de4$ cat AppRun.wrapped 
#! /usr/bin/env bash
# make sure errors in sourced scripts will cause this script to stop
set -e
this_dir="$(readlink -f "$(dirname "$0")")"
source "$this_dir"/apprun-hooks/"linuxdeploy-plugin-qt-hook.sh"
export APPIMAGE_APPLICATION_NAME=NotepadNext
exec "$this_dir"/AppRun.wrapped "$@"

Yap, the script just calles itself. I don't see any new commits here: https://github.com/AppImage/AppImageKit/commits/master nor here https://github.com/linuxdeploy/linuxdeploy-plugin-qt/commits/master - which makes the question ... more interesting.

diegoiast avatar Mar 04 '23 20:03 diegoiast