What's new

amtm amtm - the Asuswrt-Merlin Terminal Menu

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Okay, something strange (at least to me). Just installed SkyNet from amtm and it doesn't find a swapfile (nor does it ask for a location to create one), so I think I have two swap files now... This might be something for @Adamm to take a look at, I guess.

After returning to amtm, swap is found again, but in the wrong location (at least, not where I wanted it, it's in the install location of AB-Solution and Skynet, instead of on the partition I created for it.

6ovIZJ1.png
 
I have some feedback on amtm 1.0, a few thing I encountered today when first using it. As mentioned above, I started fresh today and installed amtm using the command in the OP. I know you're busy with AB4, but wanted to provide feedback before I forget it...

First thing I did after installation of amtm, I noticed a grep line in the menu. Knowing your way of coding, it's probably not supposed to be there.
"Enable JFFS custom scripts and configs" in the WebUI is already enabled btw.

ELFCwXW.png


Swapfile gets created and the amtm menu re-appears:

uESCuMY.png


Next up: install AB-Solution (what else? :D)

RdhAFtP.png


...which went fine. Next up, installing Entware:

h3PusPV.png


Worked like a charm. However, as you can see, suddenly my swap has disappeared according to amtm.
In reality it's still there though, I left amtm to check.

When returning to amtm, swap is still not detected:

e3C3QI3.png


I still have to install SkyNet, so if I find anything else, I'll post some more feedback.
Missing post mount misses a test, i wonder why noone ever mentioned that.

The abbreviated path to the device where the swap file is located is intended visual minimalism.

You then installed AB and after that Entware trough amtm instead of AB.
The standard Entware installer unceremoniously replaces the post-mount file, where the swap file is mounted and referenced from, hence amtm does no longer see it.
AB will fix the post-mount and likely see the missing link in post-mount to the swap file if you use the swap function in AB.
amtm does not have that capability.
 
I used SkyNet to uninstall the swap file it created at its install location (/mnt/ENTWARE/), and amtm now reports no swap file. However, the swapfile I created at /mnt/SWAP/ is still there, and I'm unable to remove it. I continuously get

Code:
marco@RT-AC68U:/tmp/mnt/SWAP# rm -rf myswap.swp
rm: can't remove 'myswap.swp': Operation not permitted

also, my syslog is flooding with

Code:
Jan 27 23:37:20 RT-AC68U syslog: Error unlocking -1: 9 Bad file descriptor
Jan 27 23:37:21 RT-AC68U syslog: Error locking /var/lock/networkmap.lock: 28 No space left on device

If that's referring to /mnt/SWAP (which is an ext2 partition btw), I don't get it as the swapfile is 512 Mb on a 1000Mb partition.

What can I do? Any suggestions?
 
You then installed AB and after that Entware trough amtm instead of AB.

I had some errors the last time I installed Entware through AB, before I returned to the forum, and ended it up installing entware manually with entware-setup.sh. Can't recall the exact error, it's been a few weeks ago.

Would it help if I reinstall AB?
 
I had some errors the last time I installed Entware through AB, before I returned to the forum, and ended it up installing entware manually with entware-setup.sh. Can't recall the exact error, it's been a few weeks ago.

Would it help if I reinstall AB?
For the swap errors in the previous post, this one is in use and cannot be removed unless unlinked.
Rebooting the router helps.
But you coud manually change the path in post-mount to the swap file you want to keep and then reboot.
After that remove the swap file in /Entware.

I regret to have built in the option to install Entware separately in amtm. If you do, then this is the best way to do it:
Install amtm
- install Entware trough amtm
- create swap in amtm
- install AB-Solution in amtm

This way, AB will use the existing post-mount that entware created and leave everything else intact.
 
I used SkyNet to uninstall the swap file it created at its install location (/mnt/ENTWARE/), and amtm now reports no swap file. However, the swapfile I created at /mnt/SWAP/ is still there, and I'm unable to remove it. I continuously get

Code:
marco@RT-AC68U:/tmp/mnt/SWAP# rm -rf myswap.swp
rm: can't remove 'myswap.swp': Operation not permitted

also, my syslog is flooding with

Code:
Jan 27 23:37:20 RT-AC68U syslog: Error unlocking -1: 9 Bad file descriptor
Jan 27 23:37:21 RT-AC68U syslog: Error locking /var/lock/networkmap.lock: 28 No space left on device

If that's referring to /mnt/SWAP (which is an ext2 partition btw), I don't get it as the swapfile is 512 Mb on a 1000Mb partition.

What can I do? Any suggestions?

1. Identify configured swap devices and files with cat /proc/swaps
2. Turn off all swap devices and files with swapoff -a
3. Remove the swap u saw in step 1


My step to create the swap is.
I installed entware first manually using the sh script. Then install Skynet and create swap via there. It will be on USB root. Then manually install pixelserv-tls via opkg. Then install amtm followed by AB and setup pixelserv-tls via AB.
 
If you do, then this is the best way to do it:
Install amtm
- install Entware trough amtm
- create swap in amtm
- install AB-Solution in amtm

This way, AB will use the existing post-mount that entware created and leave everything else intact.

It was a bit a late, so I forgot to reply, but I did a reboot, which was indeed mandatory to be able to remove the duplicate swapfile as I couldn't disable it with swapoff -a. Then followed the instructions you gave above, everything is now working, even Skynet by default now correctly uses the swap which I created using amtm. Thanks for your help!
 
It was a bit a late, so I forgot to reply, but I did a reboot, which was indeed mandatory to be able to remove the duplicate swapfile as I couldn't disable it with swapoff -a. Then followed the instructions you gave above, everything is now working, even Skynet by default now correctly uses the swap which I created using amtm. Thanks for your help!
Good to know, I was just suggesting a logical order without testing it. But I know the underlying workings of all scripts involved so I knew this will work.
I will code the next amtm version accordingly to suggest so.
 
Can we expect a new dnscrypt install in amtm ? I saw v2 is released but i don't know how to migrate. Do we have to clean delete previous before installing new one or it can migrate from previous version ? I'm a bit confuse. Thanks.
 
Can we expect a new dnscrypt install in amtm ? I saw v2 is released but i don't know how to migrate. Do we have to clean delete previous before installing new one or it can migrate from previous version ? I'm a bit confuse. Thanks.
See my comment here:
https://www.snbforums.com/threads/release-dnscrypt-installer-for-asuswrt.36071/page-34#post-379943
 
@thelonelycoder : I just discovered a, uhm, thingy...

I deleted my 512Mb swap file and created a new 2Gb swap file, as I'm having performance issues, most likely due to running Suricata on my RT-AC68U which eats a lot of resources. I used amtm to remove and re-create a swap file and for a minute I though it actually worked, until I realised that creating a 2 Gb swap should have taken way more time. When looking further, it appeared the 512 Mb swap wasn't deleted at all.

So I went through the steps again and this time, in a flash, I noticed there was an error, which isn't handled/caught by amtm:

Code:
swapoff: /tmp/mnt/DTSE9/myswap.swp: Cannot allocate memory
rm: can't remove '/tmp/mnt/DTSE9/myswap.swp': Operation not permitted

Apparently I can't remove my swap file, before I terminate processes which are using it, which actually makes kinda sense. Duh. However, amtm confirms removal of the old swap en confirms creation of the new swap, presumably because it just checks whether the swaps exists and not what size it actually is? That's actually something I'm not used to with scripts written by you :) ( <-- that's a compliment).

EDIT: Apparently it does remove swapon from post-mount because after a reboot, swap isn't activated, even though myswap.swp still exists. Solved things manually btw, so everything is up and running again.

I just wanted to let you know, don't know whether you actually want to do something with this, that is entirely up to you, needless to say ;).

And a question, not amtm, but swap related: back in the 'ol days I had a dedicated swap partition, marked as linux swap. There has been some discussion as to whether a swap partition would slightly outperform a swap file. If I were to make a dedicated swap partition again, would AB-Solution, Skynet etcetera be able to just use that as swap, or are they specifically looking for myswap.swp?
 
Last edited by a moderator:
And a question, not amtm, but swap related: back in the 'ol days I had a dedicated swap partition, marked as linux swap. There has been some discussion as to whether a swap partition would slightly outperform a swap file. If I were to make a dedicated swap partition again, would AB-Solution, Skynet etcetera be able to just use that as swap, or are they specifically looking for myswap.swp?

Performance is identical, swap files are preferred when the size is being changed frequently as its much easier to create a new swap file then re-partition a drive, which describes embedded systems like this quite accurately.

So I went through the steps again and this time, in a flash, I noticed there was an error, which isn't handled/caught by amtm:

Code:
swapoff: /tmp/mnt/DTSE9/myswap.swp: Cannot allocate memory
rm: can't remove '/tmp/mnt/DTSE9/myswap.swp': Operation not permitted
Apparently I can't remove my swap file, before I terminate processes which are using it, which actually makes kinda sense. Duh. However, amtm confirms removal of the old swap en confirms creation of the new swap, presumably because it just checks whether the swaps exists and not what size it actually is? That's actually something I'm not used to with scripts written by you :) ( <-- that's a compliment).

The swap function was actually originally written for Skynet then copied over when amtm came about with some adjustments. Can't say I've seen a swap file fail to "unswap" in testing, so this is a pretty edge case. While we could add a check to make sure it was actually deleted, I think in this specific case we would just get stuck in a repetitive loop. I'd have to think about a potential workaround for this situation but without blindly killing processes which is far from ideal.

I did actually add a basic check in Skynets swap creation process a few days ago that checks if there's an existing file where it plans to create the new swap file and deletes it accordingly if so, guess I forgot to merge it over to amtm. But that only solves half the issue.
 
That would be an edge case @M@rco and @Adamm , the swap file is in use by a process that the swapoff command cannot terminate.
Hence the error.
 
That would be an edge case @M@rco and @Adamm , the swap file is in use by a process that the swapoff command cannot terminate.
Hence the error.

Yeah seems like this describes the issue;

Code:
If the amount of (free) physical memory is less then the amount occupied by swap, then you cannot turn off swap.
 
The swap function was actually originally written for Skynet then copied over when amtm came about with some adjustments. Can't say I've seen a swap file fail to "unswap" in testing, so this is a pretty edge case.

I agree this most likely a rare situation. Should it fail to delete, you could consider to disable it on next boot (remove swapon from post-mount), inform the user to reboot his router and return to Skynet, amtm, AB-Solution etcetera to continue. Blindly killing processes by a script would of course be a no go.

I wasn't aware that this was originally written for Skynet, sorry. I used a swap partition already, mainly our of habit, when Skynet was still in it's early stages (and updated at least once a day, but most of the time even more frequently, lol).

I understand the benefits of a swap file instead of a swap partition, when it comes to resizing. But how about read/write activitiy? Wouldn't that benefit from a separate partition (or even a swap partition on a dedicated usb drive)? I always had swap for 'just in case' scenarios, but running Suricata now makes having a (large) swap file/partition mandatory.

One question that remained unanswered, which I'm still curious to learn the answer to:

If I were to make a dedicated swap partition again, would AB-Solution, Skynet etcetera be able to just use that as swap, or are they specifically looking for myswap.swp?
 
I agree this most likely a rare situation. Should it fail to delete, you could consider to disable it on next boot (remove swapon from post-mount), inform the user to reboot his router and return to Skynet, amtm, AB-Solution etcetera to continue. Blindly killing processes by a script would of course be a no go.

The post-mount entry is removed regardless if the swapoff process is successful or not. So after a reboot it will no longer be in use.

I understand the benefits of a swap file instead of a swap partition, when it comes to resizing. But how about read/write activitiy? Wouldn't that benefit from a separate partition (or even a swap partition on a dedicated usb drive)? I always had swap for 'just in case' scenarios, but running Suricata now makes having a (large) swap file/partition mandatory.

From my understanding there is no performance difference since the 2.6.x kernels, its now a matter of mostly convenience.

One question that remained unanswered, which I'm still curious to learn the answer to:

At the moment while the scripts will utilise them like any process, they wont internally recognise them and will have issues with certain features like displaying details of said swap partition. While adding support for swap partitions is possible, I can't say its high on the priority list right now as swap files work perfectly fine and honestly are much more convenient.
 
Thanks for your clear explanation @Adamm. I'll stick with the swap file then, as you said it's more convenient in terms of scalability.
 
While adding support for swap partitions is possible, I can't say its high on the priority list right now as swap files work perfectly fine and honestly are much more convenient.
Amen to that.
A swap file works perfectly good on these routers, i see no need to support swap partitions.
We have so many other great features coded in our scripts and support a wide range of user options but here I personally stop coding extra if-then-else tests into my scripts.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top