/etc dir autodelete file

SOONTAI

Dabbler
Joined
Nov 24, 2020
Messages
11
hi ,
I creat a new file in /etc dir , file name is wall_cmos_clock.
but after boot , truenas auto delete this file.

truenas prohibited use wall_cmos_clock?
 

NobleKangaroo

Dabbler
Joined
Apr 18, 2017
Messages
18
TrueNAS is designed to be an appliance that you don't need to manually edit files on. A result of this is that TrueNAS, similar to many other systems running on BSD/TrueOS, mount the /etc file system at boot as a temporary file system (tmpfs). A side effect of this is that anything in /etc will get "reset" on each reboot, due to the non-persistent nature of the /etc file system.

If there's something you absolutely need to do on each reboot, you could set up a cron job or an init script in "Tasks > Init/Shutdown Scripts" to call a script somewhere in your pool (e.g. create a new volume named "startup-scripts" or something like that). In your case, a simple post-init script to execute `touch /etc/wall_cmos_clock` would do the trick.
 

SOONTAI

Dabbler
Joined
Nov 24, 2020
Messages
11
TrueNAS is designed to be an appliance that you don't need to manually edit files on. A result of this is that TrueNAS, similar to many other systems running on BSD/TrueOS, mount the /etc file system at boot as a temporary file system (tmpfs). A side effect of this is that anything in /etc will get "reset" on each reboot, due to the non-persistent nature of the /etc file system.

If there's something you absolutely need to do on each reboot, you could set up a cron job or an init script in "Tasks > Init/Shutdown Scripts" to call a script somewhere in your pool (e.g. create a new volume named "startup-scripts" or something like that). In your case, a simple post-init script to execute `touch /etc/wall_cmos_clock` would do the trick.
Thank your reply, after test, Your method still can’t solve it. I set CMOS DATETIME to LOCAL TIME .
The truenas seems to force the use of UTC in bios/cmos.
I hope that cmos datetime is set to local datetime, which may be a problem of my own perception. Although I am accepting cmos clock is UTC.
In the forum, it seems that there is no effective way to solve the CMOS CLOCK setting to LOCAL TIME.
At present, I am still trying to read the relevant information in the forum. Find the closest solution.
I think the final result is that I must compromise to accept cmos datetime as UTC.
 
Top