Question

How do I save console changes?

Posted October 15, 2020 120 views
Configuration Management

Hi Guys

I am a noob. I finished making custom changes to the Jitsi file I installed. Now the console doesn’t seem to respond to inputs I enter. I want to know how to save the changes I’ve made (the changes don’t appear on the live site yet) and also more basically how to get the input to respond. If I type something currently it does not display. Am I supposed to save and exit now somehow?

I am attaching the image of my console screen:(https://ibb.co/fXwSBgY)

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hi,
Run the second instance of a console. Maybe it will get your session responsive there. If not, you can try to recover changes from a swap file. It seems you were using VIM/VI editor for editing your Jitsi file. VIM stores the changes in swap file just for recovery purposes (and for concurrent editing). VIM creates a swap file by default, unless this feature is intentionally disabled. So, it is very likely that all or most your changes are in that file. By default, the swap file is located in the same directory as edited file. Note please, that swap file is hidden (its name starts with dot symbol). So, if you can ssh your droplet, you can copy both your edited (main) file and swap file into another directory, just in case, to make a backup. And then, you can open the mainfile in VIM editor to recover the changes. For instance: you were editing a file /etc/conf/mainfile.txt and console hang. VIM should create a swap file /etc/conf/.mainfile.txt.swp. List the directory content to ensure yourself that swap file was created:

sudo ls -la /etc/conf/

Copy main and swap files to another directory, e.g. /var/tmp/

sudo cp /etc/conf/mainfile.txt /var/tmp/
sudo cp /etc/conf/.mainfile.txt.swp /var/tmp/

Open main file from original location

sudo vi /etc/conf/mainfile.txt

You will get a warning like

Output
E325: ATTENTION Found a swap file by the name "/etc/conf/.mainfile.txt.swp" owned by: root dated: Thu Oct 15 22:56:38 2020 file name: /etc/conf/mainfile.txt modified: yes user name: root host name: localhost123 process ID: 1347 (STILL RUNNING) While opening file "/var/tmp/default" dated: Thu Oct 15 22:12:01 2020 (1) Another program may be editing the same file. If this is the case, be careful not to end up with two different instances of the same file when making changes. Quit, or continue with caution. (2) An edit session for this file crashed. If this is the case, use ":recover" or "vim -r /etc/conf/mainfile.txt" to recover the changes (see ":help recovery"). If you did this already, delete the swap file "/etc/conf/.mainfile.txt.swp" to avoid this message. Swap file "/etc/conf/.mainfile.txt.swp" already exists! [O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:

Enter R for Recover. Check if changes applied, and save file.

If you are not able to ssh your droplet, then you can close the frozen console and recover changes after starting it again. You can follow all the steps mentioned before.

  • Thanks a lot. I managed to somehow get it responding again and I have made the Jitsi customization changes again but for the life of me I don’t know what command to use to save the changes? If I type “:qa!” it just starts the root again but does not save the changes?

Submit an Answer