On 02/12/2018 11:15, Tim wrote:
On 01/12/2018 12:45, Keith Edmunds wrote:
On Sat, 01 Dec 2018 12:31:46 +0000, ra...@inputplus.co.uk said:

     while sleep 50; do date -Is; swapon -s; done >swap.log
Nice, but I'd use:

    while sleep 50; do swapon -s | logger -t checkswap

That will put an entry in the system logger that's tagged 'checkswap'. You
can look at all those entries like this:

--------------------------------------------------------------------------------
$ sudo grep checkswap /var/log/messages
Dec  1 12:42:01 ws checkswap:
Filename#011#011#011#011Type#011#011Size#011Used#011Priority

Dec  1
12:42:01 ws checkswap: /dev/dm-4 #011partition#0114882428#011405688#011-1 --------------------------------------------------------------------------------

I don't like having user-defined log files: they tend to get forgotten
about and fill up disks. Using logger(1) means that the log entries are in
the system log files and thus correctly rotated, etc.

Ok stupid question time, I assume I just enter

"while sleep 50; do swapon -s | logger -t checkswap" (without the speech marks)

on the CLI, hit enter and leave it (don't close it) and then when I have an issue simply

sudo grep checkswap /var/log/messages

Assuming that is correct it has not shown me anything. Came to my PC this morning, completely locked up, hard disk light was going mad and it took around 5 minutes to show me a desktop. I did try to ssh in but that just sat there  and only allowed me to login once the PC had sorted its self out and was showing the desktop.

Tonight I will close both browser down, I have not done that yet as I have been adjusting things. I think what is happening is that swap disappears and then one of both browsers crash as the data they want is in the swap file that has crashed. Still no nearer knowing why swap is stopping.

Tim



OK (I did this before seeing the two latest replies from Keith and Ralph), I saved a copy of /var/log/messages and then imported it into a spreadsheet, a lot easier to read and manipulate 9000+ lines of a log file

I then removed all those lines which were from the firewall regarding traffic in and out, this left me with 300+ plus lines to look at. I noticed a script I added several month ago (and completely forgotten it) which cleared the swap and memory cache over night and yes the clearing swap part of the script was referencing the old swap file. The swapoff command was stopping the swap file and because it was trying to restart a non existent swap file swap never restarted. I have now updated the script with the new swap file details and we will see tonight what happens.

Assuming this is the problem, I am happy that I found it and apologise to you guys for wasting your time for what was simply a self induced problem.


Tim


--
 Next meeting at *new* venue:  Bournemouth, Tuesday, 2018-12-04 20:00
 Check if you're replying to the list or the author
 Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
 New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Reply via email to