Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Time zone resetting on reboot (Read 1764 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Time zone resetting on reboot

Every reboot on Artix /etc/localtime resets. I can manually remove it, symlink /usr/zoneinfo/America/Chicago to /etc/localtime, and my timezone will be correct until I reboot. After rebooting /etc/localtime gets set back to the contents of /etc/localtime for some reason (including every region and city). On top of this, I can manually set my root password every reboot, but as soon as I reboot the system the root password defaults back to artix. Does anyone know what is going on here?

Re: Time zone resetting on reboot

Reply #1
Every reboot on Artix /etc/localtime resets. I can manually remove it, symlink /usr/zoneinfo/America/Chicago to /etc/localtime, and my timezone will be correct until I reboot. After rebooting /etc/localtime gets set back to the contents of /etc/localtime for some reason (including every region and city). On top of this, I can manually set my root password every reboot, but as soon as I reboot the system the root password defaults back to artix. Does anyone know what is going on here?
Sorry if this is a daft question but you have installed Artix onto a drive I hope ?
What you are describing would happen if you reboot the Live CD.

Re: Time zone resetting on reboot

Reply #2
It is installed onto a drive. Everything seems to save except for the root password and the timezone, at least from what I have seen so far.

Re: Time zone resetting on reboot

Reply #3
It is installed onto a drive. Everything seems to save except for the root password and the timezone, at least from what I have seen so far.
It is installed onto a drive. Everything seems to save except for the root password and the timezone, at least from what I have seen so far.
This is not making sense. As part of the install process you would have been asked the create your user and and root password. Unless you actually choose 'artix' as the password, which I doubt the installer would allow, how could it change back to 'artix' when it never was 'artix' ?

Need more info about what you've installed, how you installed it and onto what system i.e actual computer or virtual machine  ?

Re: Time zone resetting on reboot

Reply #4
It is installed onto my main PC, no VM. It is artix-xfce-runit. During the install process I did not set the root password to artix. It seems to be a really strange issue that reinstalling would fix, but I don't want to lose all of the configuration I have done. I installed it through the GUI installer from the live USB. Really not sure how it could have happened.

Re: Time zone resetting on reboot

Reply #5
Really not sure how it could have happened.
Me neither.

If this was happening to me I'd want to know more about when the two files were modified (among other things), if indeed they are being modified.

While linking /etc/localtime is the 'classic' way to do it you can also just copy.
Out of curiosity try this (as root), if you like, and post all the output
Code: [Select]
mount  #I'd like to see what's mounted where
ls -al /etc/passwd /etc/localtime
date
cp -av /usr/zoneinfo/America/Chicago /etc/localtime
passwd
ls -al /etc/passwd /etc/localtime
Shut down, wait a short while (e.g. 5 min) and restart
Code: [Select]
ls -al /etc/passwd /etc/localtime
date

Edit: Also is the Live USB still connected ?

Re: Time zone resetting on reboot

Reply #6
Live USB is not plugged in.

Code: [Select]
[nick@artix] ~ $ mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=8142956k,nr_inodes=2035739,mode=755,inode64)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755,inode64)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
/dev/sda2 on / type ext4 (rw,noatime)
securityfs on /sys/kernel/security type securityfs (rw,relatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,relatime,inode64)
cgroup_root on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755,inode64)
openrc on /sys/fs/cgroup/openrc type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/usr/lib/rc/cgroup-release-agent,name=openrc)
none on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cpuset on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cpu on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cpuacct on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
blkio on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
memory on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
devices on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
freezer on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
net_cls on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
perf_event on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
net_prio on /sys/fs/cgroup/net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_prio)
hugetlb on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
pids on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
rdma on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
misc on /sys/fs/cgroup/misc type cgroup (rw,nosuid,nodev,noexec,relatime,misc)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /tmp type tmpfs (rw,noatime,inode64)
/dev/sdb1 on /home/nick/500GBSSD type ext4 (rw,relatime)
binfmt on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tmpfs on /etc/pacman.d/gnupg type tmpfs (rw,relatime,size=10240k,mode=755,inode64)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1630396k,nr_inodes=407599,mode=700,uid=1000,gid=1000,inode64)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)


After reboot


Code: [Select]
[nick@artix] ~ $ doas ls -al /etc/passwd /etc/localtime
lrwxrwxrwx 1 root root   20 Aug  7 14:47 /etc/localtime -> /usr/share/zoneinfo/
-rw-r--r-- 1 root root 1369 Aug  5 14:14 /etc/passwd


Code: [Select]
[nick@artix] ~ $ date
Sat Aug  7 14:53:58 UTC 2021

So it seems to me like every reboot /etc/localtime is being symlinked to /usr/share/zoneinfo for some reason. Really doesn't make sense to me why this would be happening. For now I edited /etc/rc.local to manually delete the files in /etc/localtime and symlink /usr/share/America/Chicago to them, which fixes the issue of my timezone being incorrect (albeit in a hacky way).

Re: Time zone resetting on reboot

Reply #7
You didn't follow all the steps I mentioned. Or at least if you did you didn't post all the output.
Not a criticism, just an observation.

Is your password still being reverted ?
'cos I noticed the modified date on /etc/passwd is older than today.

If it was me I'd be considering starting again. As we both know this should not be happening. You've noticed this is wrong but there could be other things that are so far unnoticed.

But also I'd probably be grepping for 'zoneinfo' & 'localtime' in /etc to start, and then the whole of /. To see if any scripts are doing this.
So weird.
I doubt I can help you further? I only posted in the first place to exclude the obvious possibility that you were still on the Live-cd (it happens)
But if you do persevere, and have any more thoughts and observations post them.

If you do start again make sure to check the timezone and root password first. To check all is well before you do anything else.

Hope you get it sorted.

Re: Time zone resetting on reboot

Reply #8
Ah sorry about that, I had everything you told me to do but it didn't save in the draft for some reason. Everything you told me to do had normal outputs, nothing looked like it was being modified except for when I did it.

EDIT: I probably won't bother reinstalling because I have the startup script that is setting my timezone, but if I encounter more issues and I need to wipe it I will. Thanks for trying to help :)

Re: Time zone resetting on reboot

Reply #9
Have you set the hostname, it looks like it is the default "artix" in your output? I got some very odd networking problems with a hostname containing numbers, so hostname problems can give strange effects.
In my case I see /etc/shadow being modified when I change the password as that's where the encrypted password is stored, but not /etc/passwd.
Code: [Select]
$ ls -l /etc/shadow
-rw------- 1 root root 618 Jul  3 03:19 /etc/shadow
$ sudo passwd me
[sudo] password for me:
New password:
Retype new password:
passwd: password updated successfully
$ ls -l "/etc/shadow"
-rw------- 1 root root 618 Aug  8 01:59 /etc/shadow
There are backup files for shadow and passwd too with - at the end, perhaps that's where it is being reinstated from somehow.
If you really want to know when and by what something is being modified then libaudit will do this, and one of the predefined standard setups will monitor timezone  and password changes, so no need to write your own rules. But if you haven't used it before then it could take a bit of reading to do so!

Re: Time zone resetting on reboot

Reply #10
It seems like your root FS remains mounted ro instead of rw. Perhaps it was mounted with errors while mounting root. How is root partition defined in your /etc/fstab?

Re: Time zone resetting on reboot

Reply #11
"/dev/sda2 on / type ext4 (rw,noatime)"
Not sure about that, from the output provided above.
I have an idea of one possiblity that could cause this - some remnant from the install process. Try searching your services and packages (pacman -Qs) for things like calamares, install, firstrun, firstboot, that kind of thing, look in /etc/init.d (or equivalent if not using OpenRC), use pacman -Qo on any suspect files. Usually GUI installers autoremoves some package(s) which sets things up as a final installation action, but if that didn't happen for some reason, it might run every boot and set things to the defaults.
Also search /etc recursively for the password and timezone getting reset to try and see if it's a script doing this using grep -r or something.

Re: Time zone resetting on reboot

Reply #12
I do have all those packages, simply because I installed artix-live-base and artix-live-runit for the tools they came with. Uninstalling those tools does not change anything.  As for my hostname, I have manually set it to artix. I fixed the timezone issue by changing /etc/rc.conf to HARDWARECLOCK='localtime'. I think this is some artifact of dual booting with windows. Root password issue is strange but I am not very worried about it honestly.

Re: Time zone resetting on reboot

Reply #13
I do have all those packages, simply because I installed artix-live-base and artix-live-runit for the tools they came with.
Then look at the /etc/rc/sysinit and /etc/rc/shutdown directories, what scripts are listed there. If something resets your system settings to the default ones, the chances are that it's in these dirs.

Re: Time zone resetting on reboot

Reply #14
Code: [Select]
[nick@artix] ~ $ ls /etc/rc/sysinit
01-sysfs     20-kmod-static-nodes  35-cryptsetup     70-random-seed
02-procfs    25-tmpfiles-dev       40-console-setup  75-tmpfiles-setup
03-devfs     30-udev               45-net-lo         80-sysusers
04-cgroups   31-udev-trigger       50-misc           85-dmesg
05-root      32-modules            55-remount-root   90-sysctl
10-hostname  33-udev-settle        60-mount-all      95-binfmt
15-hwclock   34-lvm2               65-swap           99-cleanup

Code: [Select]
[nick@artix] ~ $ ls /etc/rc/shutdown
10-random-seed  30-udev     40-misc  60-root  65-cryptsetup
20-cleanup      35-hwclock  50-swap  64-lvm2  70-remount-root

Nothing in those scripts seems to be changing the root password.