how to remove bad tunable?? where is Loader prompt?

SMnasMAN

Contributor
Joined
Dec 2, 2018
Messages
177
I cant for the life of me find out how you remove a bad tunalbe from FN 11.2.

there is this excellent entry in the 8.2 manual:
https://www.ixsystems.com/documentation/freenas/8.2/freenas.html#__RefHeading__66967_627492046

but nothing even close to that in the 9.3 - 11.2 manuals.
(i think bc FN moved to grub, so no more loader?)

so how do i get rid of a bad tunable that keeps getting auto applied at boot?

(btw its one of these below that is killing everything, via shell i can reverse it so that networking comes back up and i can do service openssh restart , to get ssh (same w nginx, but cant login to web gui) , so i cant get to web gui screen to disable the tunable):

net.inet.tcp.sendspace=2097152
net.inet.tcp.sendbuf_inc=32768
net.route.netisr_maxqlen=2048

tks
 

SMnasMAN

Contributor
Joined
Dec 2, 2018
Messages
177
not sure if this is the way to get to loader now (THE MANUAL NEEDS TO BE UPDATED TO ADDRESS THIS / BAD TUNABLES, just like the 8.3 manual!)

https://www.ixsystems.com/community/threads/setting-tunables-at-time-of-install.71985/post-504420

but for those looking, this is what i ended up having to do (there *has* to be a better way):

Code:
[root@freenas /etc]# sqlite3fn
sqlite> .open /data/freenas-v1.db
sqlite> .tables

sqlite> SELECT * FROM system_tunable WHERE tun_enabled = 1 AND tun_type = 'sysctl' ORDER BY id;
10|2097152|sysctl||1|net.inet.tcp.sendspace
11|2048|sysctl||1|net.route.netisr_maxqlen
sqlite> PRAGMA table_info(system_tunable);
0|id|integer|1||1
1|tun_value|varchar(512)|1||0
2|tun_type|varchar(20)|1||0
3|tun_comment|varchar(100)|1||0
4|tun_enabled|bool|1||0
5|tun_var|varchar(128)|1||0
sqlite> update system_tunable set tun_enabled=0 where id=10;
sqlite> SELECT * FROM system_tunable WHERE tun_enabled = 1 AND tun_type = 'sysctl' ORDER BY id
   ...> ;
11|2048|sysctl||1|net.route.netisr_maxqlen
sqlite> update system_tunable set tun_enabled=0 where id=11;
sqlite> .quit
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Please file a ticket in the bug tracker.
 

jbeez

Dabbler
Joined
Feb 9, 2015
Messages
48
not sure if this is the way to get to loader now (THE MANUAL NEEDS TO BE UPDATED TO ADDRESS THIS / BAD TUNABLES, just like the 8.3 manual!)

https://www.ixsystems.com/community/threads/setting-tunables-at-time-of-install.71985/post-504420

but for those looking, this is what i ended up having to do (there *has* to be a better way):

Code:
[root@freenas /etc]# sqlite3fn
sqlite> .open /data/freenas-v1.db
sqlite> .tables

sqlite> SELECT * FROM system_tunable WHERE tun_enabled = 1 AND tun_type = 'sysctl' ORDER BY id;
10|2097152|sysctl||1|net.inet.tcp.sendspace
11|2048|sysctl||1|net.route.netisr_maxqlen
sqlite> PRAGMA table_info(system_tunable);
0|id|integer|1||1
1|tun_value|varchar(512)|1||0
2|tun_type|varchar(20)|1||0
3|tun_comment|varchar(100)|1||0
4|tun_enabled|bool|1||0
5|tun_var|varchar(128)|1||0
sqlite> update system_tunable set tun_enabled=0 where id=10;
sqlite> SELECT * FROM system_tunable WHERE tun_enabled = 1 AND tun_type = 'sysctl' ORDER BY id
   ...> ;
11|2048|sysctl||1|net.route.netisr_maxqlen
sqlite> update system_tunable set tun_enabled=0 where id=11;
sqlite> .quit


Thanks so much for this. I've condensed this down a little for people maybe. At least I find it preferable.
I had an issue with a botched sysctl, I connected to the console, got a second tty because the first was getting destroyed with scrolling messages, I think its ctrl-alt-f2? something like that. Logged in as root.
Saved what I had in there for posterity, *you can also make a copy of freenas-v1.db if you wish*
Code:
sqlite3 /data/freenas-v1.db 'SELECT * FROM system_tunable;' > /mnt/bulk/backup/system_tunable.txt

or if you want it a little easier to read when you goto re-enter by hand:
Code:
sqlite3 /data/freenas-v1.db 'SELECT * FROM system_tunable;' | cut -d '|' -f 2,6 | sed s'/\|/ /g' | awk '{print $2" "$1}' > system_tunable.txt


Finally if you don't care about backing up any of that and you just want your system back to functioning...
Code:
sqlite3 /data/freenas-v1.db 'DELETE FROM system_tunable where id>0;'

OR just disable all of the tunables so you don't have to keep re-entering them.
Code:
sqlite3 /data/freenas-v1.db 'UPDATE system_tunable SET tun_enabled = 0 WHERE id>0;'

Hope this helps!
 
Last edited:

profwalken

Patron
Joined
Nov 19, 2013
Messages
410
@jbeez
I'm facing same kind of problem, on a TN core13 , i did a wrong setting on one tunable, my server has 2 NICs and I choose EM0 instead of IGB0.
Now i lose access from GUI.
I have no idea how to proceed to only disable the faulty line (i'm certain this is : natd_interface em0 )

Do you have an advice , with steps I need apply (I'm not an expert in linux) this is a production system so I need to get it back working
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Do you have an advice , with steps I need apply
I would recommend that you read the post above yours.

The last command would probably get you back to working and then you can re-enable the ones you still need in the GUI.
 

profwalken

Patron
Joined
Nov 19, 2013
Messages
410
Thanks for answer,
finally, I got the chance to find TN GUI available from local LAN, so finally I didn't understood what was the why but for sure when I set em0 instead of igb0, I lose the remote access to GUI.
Thinking I just needed to edit the line and revert to igb0 , but after reboot this produced the exact opposite behavior, I was unable to access GUI from local LAN and it worked remotely.
To close the problem for today , I just disabled all what I had did related to OpenVPN, rebooted once more and got it back like it was before
 
Top