WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Problems with *.tcz startup-scripts and "Install to File System" (copy2fs.flg)  (Read 1804 times)

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Hi!
Playing around with the "Install to File System" feature lately, I noticed a problem if loading an extension containing a startup-script that symlinks or copies files from  /tmp/tcloop/...  to some place in the filesystem in RAM.

F.e.:
- "Default Install to File System Flag" is set (i.e.  /etc/sysconfig/tcedir/copy2fs.flg  exists).
- foobar.tcz  is in the OnDemand list.
- foobar.tcz  contains  /usr/local/tce.installed/foobar
Code: [Select]
#!/bin/sh
ln -s /tmp/tcloop/foobar/usr/local/foobar/foobar /usr/local/bin/
- /usr/local/bin/foobar  will be a dead symlink since  /tmp/tcloop/  is empty.
- Running  foobar  will create an infinite loop, as the only valid command found in $PATH will be
 /etc/sysconfig/tcedir/ondemand/foobar , which will call itself again and again.

At least  pppd.tcz  and  perl5.tcz  make use of the  /tmp/tcloop  directory in their startup-scripts.

I experienced the infinite loop using my personal firefox.tcz that is using a startup-script from an older version from the official repo.
Changing the script to the following still works fine for me if NOT using  copy2fs.flg .
Code: [Select]
#!/bin/sh
ln -s /usr/local/foobar/foobar /usr/local/bin/
(Works fine too if I DO use  copy2fs.flg .)

Also, plain  cp  will not copy symlinks but the actual files they point to.

Question:
Is there any downside in omitting  /tmp/tcloop/foobar  in the startup-script?

If not so, I (or someone who speaks proper english) may add this info to the startup-script section of the wiki
("Don't use  /tmp/tcloop  in your startup-script as this directory doesn't necessarily contain any files!").

Cheers.
« Last Edit: September 19, 2015, 08:49:41 AM by Misalf »
Download a copy and keep it handy: Core book ;)

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
A while ago openoffice wouldn't work without including /tmp/tcloop in symlinks, but I haven't seen anything complain lately.

Please go ahead and make a note in the wiki.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Added a warning, saying "Don't, unless absolutely necessary".
Download a copy and keep it handy: Core book ;)