I could put it in init.d so it only happens on boot. To make it only happen if really needed seems a bit harder. The user may add the SFS to the boot list, remove it and then add it again. If ldconfig was run with it unplugged, it needs to run again with it plugged in.RSH wrote:That's how things usually do evolve.I think I may have an even smarter smarter idea
That's just where the expert is split from the newbie.Instead why not mount the SFS via a loopback use the ldconfig and then dismount. It never needs to be pulled into the normal file system just to run it once at start up.
A hint, though: what about a temp file to be created after it has been executed once (to avoid re-running/-loading when just X is restarted for another reason)?
Perhaps I can just live with it happening more than needed. Putting it in Startup is nice because I can ask permission which I always want to do in such a case.
Code: Select all
if ! ( ldconfig -p | grep -q THENAME ) ; then
do the stuff
else
don't do the stuff
fi