Tiny Core Base > TCB Bugs

tc-config runs tc-restore.sh too late

(1/3) > >>

philip:
Summary: Please consider modifying the bootup script /etc/init.d/tc-config so that tc-restore.sh gets invoked earlier.

Rationale: My TC-2.0rc3 install starts very slowly because I need the openssh extension. That package comes with a script called /usr/local/tce.installed/openssh whose job is to make sure the system has usable encryption keys in the right places. If the keys are missing, the command ssh-keygen is used to make new ones. My hardware is old, so this takes several minutes. Now here's the kicker: the keys are missing every time -- in spite of being mentioned in /opt/.filetool.lst -- because the bootup process runs the script just mentioned before restoring the files in my backup. So I wait a long time for ssh-keygen to make new keys, and then they get obliterated immediately as the saved ones are overwritten on top of them. So I suggest re-sequencing /etc/init.d/tc-config a little, to restore files from the backup before running the extension-setup scripts. I tried this on my own system with good success.

Brainstorming: Restoring files from the backup early gives users more influence on how the boot process goes forward (probably good), but increases the risk that the boot process will overwrite files that the user has customized (probably bad). If my suggested re-sequencing is immune to the latter risk, please do it. If it's not, more thinking will be needed. We could read the files from the backup twice: once before the extension scripts get executed and once more afterward, just in case any user-generated files got damaged. Or we could make one of those two steps optional, to be triggered with yet another boot parameter. I'm sure our crack development team can come up with additional possibilities and implement the best of the bunch.

Thanks.

curaga:
In previous versions the backup was restored before extensions, but it was modified to be later for the exact reason you saw too - user-customized files would not overwrite fresh ones from extensions.

Extracting the backup twice would take system resources, in case the backup was big. But as the goal is to only have dynamic content there, and static content in an extension, it might be viable.

On the other hand, since your keys are very unlikely to change, why not make an extension out of them? It would guarantee being loaded before the installation scripts, and save backup time too.

philip:

--- Quote from: curaga on May 29, 2009, 03:56:12 AM ---... since your keys are very unlikely to change, why not make an extension out of them?

--- End quote ---
This is an interesting suggestion and I will look into it.

The short answer to your question is a combination of, "I didn't think of it" with "I don't know how." So I'll go learn and report back ... no problem. But, considering TC as a whole, I'm nervous about the level of technical expertise this kind of response demands of a general user. So I'm asking for a little more discussion of the design decision at work here.

More brainstorming: what if the system were built to look for an optional second list of files that gets treated almost exactly like /opt/.filetool.lst, only restored earlier in the boot sequence? We could call it /opt/.filetool-early.lst and mention how to use it in the notes that support the openssh extension. Figuring out how to succeed with a setup like that is well inside my "naive user" comfort zone; building extensions isn't.

Guy:
In regards to:


--- Quote ---why not make an extension out of them?

I don't know how.
--- End quote ---

Here is how to make an extension of background images.

/background.html][removed due to policy violation]/background.html

You could do the same type of thing with the files you want in an extension.

roberts:
I have always promoted factoring out static content from one's backup into personal tces.

Don't think of it as I need to learn how to make an extension. After all the backup (mydata.tgz) is really the same format as a tce. While true, most extensions have menu items and icons, but they are not required.

Since you already have identified your ssh files in .filetool.sh, the hardest part is already done.

Copy .filetool.lst to say for example myssh.lst. Next edit out all the lines except those for your ssh configuration from myssh.lst.  Then issue a tar command like this:

tar -C / -T myssh.lst -zcvf myssh.tce

Copy your myssh.tce to your tce directory. Done.

Navigation

[0] Message Index

[#] Next page

Go to full version