Tiny Core Linux
Tiny Core Extensions => TCE Talk => Topic started by: NinjaCowboy on January 21, 2019, 09:34:21 PM
-
I've accumulated a lot of files in my (persistent) home directory, and I noticed that my system is taking a really long time to boot (over 2 minutes). I investigated this by editing the tce-load script, adding 'sh -x' where it executes an extension's tce.installed script (so I can see every command as it is being executed). I found that the main culprit of slowness is the /usr/local/tce.installed/Xlibs script:
#!/bin/sh
read USER < /etc/sysconfig/tcuser
[ -f /home/"$USER"/.xsession ] || cp /etc/skel/.xsession /home/"$USER"/.
[ -f /home/"$USER"/.setbackground ] || cp /etc/skel/.setbackground /home/"$USER"/.
[ -f /home/"$USER"/.Xdefaults ] || cp /etc/skel/.Xdefaults /home/"$USER"/.
[ -d /opt/backgrounds ] || mkdir /opt/backgrounds
chown -R "$USER".staff /home/"$USER" 2>/dev/null
chmod g+w /opt/backgrounds 2>/dev/null
sudo chown -R root.staff /usr/local/tce.installed 2>/dev/null
sudo chmod -R 775 /usr/local/tce.installed 2>/dev/null
In particular, this line
chown -R "$USER".staff /home/"$USER" 2>/dev/null
which takes about a minute to recursively change the ownership of every single file in my home directory to tc.staff (which it should already be set to, anyway). So yeah, that's a whole MINUTE of boot time (plus thousands of flash write cycles) wasted on a POINTLESS operation. I'm using piCore 9.0, but I'd expect this to affect anybody using a persistent home directory with X installed.
-
Hello NinjaCowboy
chown -R "$USER".staff /home/"$USER" 2>/dev/null
chmod g+w /opt/backgrounds 2>/dev/null
Neither of these commands exist in Xlibs startup scripts for tc-9x, tc-10x, in x86 or x86_64 versions. So I have to wonder what version of TC you're using?
It looks like a modification that someone made in troubleshooting, then forgot...?
-
Hi coreplayer2
... It looks like a modification that someone made in troubleshooting, then forgot...?
I just checked a TC4 machine and those commands are present in the startup script. I think the chown line in question was
an overly broad way of insuring correct ownership for these 3 lines:
[ -f /home/"$USER"/.xsession ] || cp /etc/skel/.xsession /home/"$USER"/.
[ -f /home/"$USER"/.setbackground ] || cp /etc/skel/.setbackground /home/"$USER"/.
[ -f /home/"$USER"/.Xdefaults ] || cp /etc/skel/.Xdefaults /home/"$USER"/.
If you look at those 3 lines in the TC9 version you'll note they have chown commands appended to them.
-
Hi coreplayer2
I just checked a TC4 machine and those commands are present in the startup script. I think the chown line in question was
an overly broad way of insuring correct ownership for these 3 lines:
[ -f /home/"$USER"/.xsession ] || cp /etc/skel/.xsession /home/"$USER"/.
[ -f /home/"$USER"/.setbackground ] || cp /etc/skel/.setbackground /home/"$USER"/.
[ -f /home/"$USER"/.Xdefaults ] || cp /etc/skel/.Xdefaults /home/"$USER"/.
If you look at those 3 lines in the TC9 version you'll note they have chown commands appended to them.
Indeed I saw that, more importantly I noted that chown appended to these commands were targeted at specific files, not recursive.
I hear you, was used many years ago and has been corrected/updated at some point. So, how is it a new TC user has this old version of Xlibs?
Is the quick answer here to update his system? Maybe this issue is not applicable in TC-9 and above?
-
Hi coreplayer2
... Is the quick answer here to update his system?
The OP is running piCore 9.0 so it appears the change never made it to piCore. I don't know when it changed in Tinycore. I only
looked at versions 4 and 9.
-
Hi coreplayer2
The OP is running piCore 9.0 so it appears the change never made it to piCore. I don't know when it changed in Tinycore. I only
looked at versions 4 and 9.
Is this tc-4 system the one which hasn't been rebooted in 10 years by chance??
Anyhow, since I was curious because of this I'd expect this to affect anybody using a persistent home directory with X installed.
I checked further.. The change occurred during 2013 in TC-5x
-
Hi coreplayer2
... Is this tc-4 system the one which hasn't been rebooted in 10 years by chance?? ...
Close. It's the system that gets rebooted every 1.5 to 2 years. :)
-
Oh sorry I didn't realize that it only affects piCore. Feel free to move this topic to the Raspberry Pi section if it makes sense. It seems a recurring issue that versions of extensions in piCore aren't kept in sync with the x86 and x86-64 versions.