Settings reverting and files disappearing on reboot

littlecharva

Cadet
Joined
Jul 21, 2011
Messages
4
Hi,

I'm new to FreeNAS 8, but ran a 0.69 FreeNAS box for a while before upgrading.

I'm also a bit of a Linux/FreeBSD newb too, but I feel I'm starting to get my head around the whole thing.

Ultimately I'm trying to install MPD5 in order to setup a PPTP server, but the problems I'm encountering seem to be with FreeNAS.

I ssh into FreeNAS from my Windows machine, and then I use su to work as the root account.

I then use nano /etc/rc.conf and make a few changes to that file. Using Ctrl-X to exit, then saying Yes to write out changes tells me that it wrote 48 lines.

I then nano in again to check the file and my changes are still there.

Finally, I reboot and when I check the file again, the changes I've made are gone.

Also, the files and folders setup by the MPD5 installation (/usr/local/etc/mpd5) have vanished.

What am I doing wrong?

Anthony
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
FreeNAS settings are stored in a database which rebuilds a lot of the system files every time you boot. Also those partitions are likely in RAMdisk and get wiped everytime you reboot. There are some discussions here about this, but you'll have to search to find them.
 

littlecharva

Cadet
Joined
Jul 21, 2011
Messages
4
Hi Protosd,

Thanks for the response, but I can't seem to find any posts on this at all. I've tried searching for settings database, ram disk and ram partition, but none of the results contain anything relevant.

Can you suggest any other keywords I could try?

I have previously managed to add some Transmission entries in the rc.conf file following a tutorial for installing Transmission, but I'm unable to identify which steps lead to that working.

Anthony
 

pauldonovan

Explorer
Joined
May 31, 2011
Messages
76
mount -uw /
ee /etc/rc.conf
mount -ur /

Searching the forums for those mount commands will help, as will just performing them :smile:

Paul
 

ohnename

Explorer
Joined
May 26, 2011
Messages
88
make your changes in /conf/base/etc (only after a mount -uw /) because thats whats read on boot, it is also automatically changed in /etc after a reboot.
 

Durkatlon

Patron
Joined
Aug 19, 2011
Messages
414
make your changes in /conf/base/etc (only after a mount -uw /) because thats whats read on boot, it is also automatically changed in /etc after a reboot.

Is that true? I'm comparing /etc and /conf/base/etc and the directories are nothing alike. The file I'm interested in modifying (snnmpd.config) is much larger in the conf/base and in fact has the options I would like to have loaded from the version in /etc.

EDIT: I guess some files (like rc.conf) are taken directly from /conf/base/etc, while others that exist in /conf/base/etc (like snmpd.config) are not used at all, but instead built from scratch each time by other scripts. In the case of snmpd.config the script is /etc/rc.d/ix-bsnmpd, so to make permanent changes you have to modify /conf/base/etc/rc.d/ix-bsnmpd.

I was expecting FreeNAS being that it is based on nanobsd to follow the convention that permanent configuration is stored in the partition that is temporarily mounted to /cfg during boot-up, but when I mounted /cfg it appears this partition is completely empty? I guess IxSystems changed that completely from the baseline.
 

king3382

Cadet
Joined
May 13, 2012
Messages
2
mount -uw /
ee /etc/rc.conf
mount -ur /

Searching the forums for those mount commands will help, as will just performing them :smile:

Paul

after run mount -ur /, it prompted me "mount: /dev/ufs/FreeNASs1a : Device busy"

anyone who can figure out detailedly how to install NRPE2 into freenas 8, or install any software permanently. i noticed that a lot of users has same problem with read only file system, were unable to install software.

thanks!
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
i noticed that a lot of users has same problem with read only file system, were unable to install software.

This is by design! If you try to install apps by making / read-write, you will suffer the consequences...

This is what the plugin system in 8.2 is intended for. It's a little behind schedule, but we should have an RC release in the beginning of June.
 

king3382

Cadet
Joined
May 13, 2012
Messages
2
This is by design! If you try to install apps by making / read-write, you will suffer the consequences...

This is what the plugin system in 8.2 is intended for. It's a little behind schedule, but we should have an RC release in the beginning of June.

thank you so much.

your answer is very clear. hope like this information should be included in doc.
 
Joined
Apr 22, 2020
Messages
3
Hi guys, sorry to bring back that discussion. I really need to know if exist a way to keep changes on /usr/local/etc. I am using the lastest version and I tried many time the suggestion of mount the / as RW... it did not work. Any suggestion or idea for that.

I need to add one line in /usr/local/etc/sudoers for a specific user can run a script without been asked for password.
 
Joined
Apr 22, 2020
Messages
3
I was wanted do grant for a user sudo access to run a specific command... for achieve that was needed to add the info in the file below and do a restart in the server:
- /conf/base/etc/local/sudoers

I was wanted to change the default sudo permission from ALL=(ALL) ALL to ALL=(ALL) NOPASSWD: ALL. To achieve that I needed to change that information in the file /conf/base/etc/ix.rc.d/ix-sudoers (freenas 11.1) and /usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/sudoers (freenas 11.3)
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
@rosivaldocorrea First things first: please open a new thread stating your current problem with as much information as possible and a proper thread title. Let this dead one from 2011 (!) rest in peace.

Kind regards,
Patrick
 

cogprying

Dabbler
Joined
Jun 3, 2017
Messages
12
I was wanted do grant for a user sudo access to run a specific command... for achieve that was needed to add the info in the file below and do a restart in the server:
- /conf/base/etc/local/sudoers

I was wanted to change the default sudo permission from ALL=(ALL) ALL to ALL=(ALL) NOPASSWD: ALL. To achieve that I needed to change that information in the file /conf/base/etc/ix.rc.d/ix-sudoers (freenas 11.1) and /usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/sudoers (freenas 11.3)

Thank you so much for posting this! This is the top result in Google querying where to edit ttys now, even in 2022. As far as I could find, there's nothing in the release notes about the inane placement of these settings under a python subdirectory from the more intuitive /conf/base/etc in 11.3.

Really awesome of you to take the time to post the solution; so many posts here are just useless pearl clutching and smug reproach, which provide no utility to anyone. It makes it even more frustrating dealing with the constant sunk cost of maintaining a FreeNas TrueNAS system, so it's nice to actually find an answer for a change. Cheers!
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
What an arcane and entirely uneccessary way of going about creating or modifying an sudoers file. First what you are doing is unsupported. Second, if you insist on doing it, anyway, just create a post init task that does the intended modifications at every boot. Maintainable, supported, surviving upgrades, ....
 

cogprying

Dabbler
Joined
Jun 3, 2017
Messages
12
I don't know if this response was directed at me, but I'm not editing the sudoers file, but another boot one (ttys) which there is otherwise no method to do so, as far as I can find, and was moved from /conf/base/etc (where it had existed for many iterations). Did you notice the guy whose post you suggested they create their own thread about their problem, was only posting a solution, and not a problem at all?

It's wonderful they took the time to share: I actually just went through the various release notes for 11.1+ through 11.3, and I can't find where it's documented at all about the file paths being moved!
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You are simply not supposed to mess with the core components of an embedded appliance. What are you complaining about? Of course they move files at will. There are no user serviceable paths there. And of course you can modify the ttys file in a post init task that ends in kill -HUP 1 to have the init process re-read it. Messing with either the /conf/base files from the old NanoBSD based architecture or their python code is not getting you anywhere and giving people these instructions is not sharing but misleading and dangerous.

The switch from NanoBSD to a completely new architecture was announced, documented and performed YEARS ago.

I really don't know what to say. This is not how to work with a system.

And now I necroed this dang thread that deserves to die with the alread dead FreeNAS 11. Could a mod please just close it.
 
Top