LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-14-2017, 09:29 PM   #1
summersab
LQ Newbie
 
Registered: Feb 2015
Posts: 23

Rep: Reputation: Disabled
Dynamically linked config files - just musing


I'm pretty well-versed in *nix administration. I'm no developer or hardcore coder, but I can get my way around code well enough to be dangerous.

I wish there was a filetype that was actually two (or more) files chained together. From the user perspective, it is a single file; however, once saved, it is actually multiple files. There would need to be markers in the source file to indicate where to split, but that's not hard. This would solve things like above-the-fold CSS problems by allowing all CSS to be managed in a single place while in reality having it split up dynamically for purposes of efficiency.

Conversely, I wish there were a way to dynamically "embed/link" config files. Say you have multiple htaccess files, but they all need to have the same mod_deflate directives. There could be a single mod_deflate file that is referenced by all htaccess files - edit the "master file," and all the others inherit those changes.

I can think of ways to build these structures by creating static versions of the desired files whenever the source files are changed, but that gets messy - nothing prevents the static copies from being accidentally changed. There is no solid parent/child link that would persist after file save to prevent that modification.

I suppose I'm just rambling, but does anything exist that I'm just not aware of?
 
Old 07-15-2017, 06:09 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,662

Rep: Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710
Yes.

Webmin interfaces for some applications have one settings screen. When you sumit the settings they are written out to the config files where they are needed, one file or many.

May config systems that were once a single config file now include an "include" macro that can load up settings from another file, or all the files in a special folder. Applications are routinely written to include directory parse functionality.

Example: not long ago /etc/profile was critical. It still is, but check out /etc/profile.d as well.

Man pages do a good job of letting you know if your application handles a setting folder instead of, or in addition to, a settings file.
 
Old 07-15-2017, 07:37 PM   #3
summersab
LQ Newbie
 
Registered: Feb 2015
Posts: 23

Original Poster
Rep: Reputation: Disabled
While that is indeed true, there is an application layer or management system that is required for that to work (and they're all different). Instead, how nice would it be if there were a way to do this at the system level? The second case would be easier to accomplish and could be an extension of ln and tar in a way (by way of analogy, really). For instance:
Code:
ln -l [parent] [child1] [child2] [childN]
The -l option would be "link," and it would instruct the system to dynamically chain the files together when read. Since tar is nothing more than a bitstream of files clumped together with a header table specifying where each file starts and stops, code that is similar to that could do the actual work. When running ls -l, the linked child files would be shown.

The first case is quite a bit harder to handle from the system level. To use my previous analogy in reverse, imagine editing a tar file using vi to edit the files that are contained. One would have to know what file is currently be edited on the current line and make sure to update the header tables at the top with where each file now starts and stops in the stream. I can envision how that could be accomplished, but it's not as easy as the opposite direction.

I'm not posting so as to suggest that these things need to be implemented. Rather, I'm just musing. I sure wouldn't complain if they WERE implemented - there are definitely problems that could be solved by such structures!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] gcc toolchain works but dynamically linked executables won't run (without help) prushik Linux - Software 5 02-01-2013 10:25 AM
What's the difference between static and dynamically linked library... trist007 Linux - Newbie 5 09-19-2010 08:40 PM
[SOLVED] g++ dynamically linked library not being found posop Programming 6 04-14-2010 03:20 PM
Dynamically linked libraries.. vishalbutte Programming 6 04-17-2006 08:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration