LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-06-2019, 08:02 PM   #1
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
Linux configuration files naming convention


Hello!

Sorry I can't remember where I read this before. I am looking for a document that would tell me what the file naming conventions are for. I forgot what this convention/structure is called, but I think this is supposed to be in addition to FHS.

Example:
Code:
.../conf.d/
10-*.conf
20-*.conf
30-*.conf
TIA.
 
Old 01-06-2019, 08:15 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,323
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
In my experience, configuration files generally have the extension *.conf, except for runtime configuration files, which tend not to have extensions and tend to be named "[program name]rc," such as "bashrc."

In certain cases, such as BSD style init systems such as used by slackware, the rc files that run during system initialization are named "rc.[process name]. Here's examples from my own system (the ones in the far left column are directories).

Code:
rc.d/ $ ls
init.d       rc.atalk          rc.cgred.orig    rc.fuse         rc.loop            rc.openvpn     rc.sshd           rc1.d
rc.0         rc.atalk.orig     rc.consolekit    rc.gpm          rc.lxc             rc.pcmcia      rc.syslog         rc2.d
rc.4         rc.autofs         rc.cpufreq       rc.httpd        rc.mcelog          rc.php-fpm     rc.sysstat        rc3.d

(snip)
A web search for "linux file naming conventions" will turn up a number of good articles. This is an excellent one: https://library.stanford.edu/researc...es-file-naming

As an aside, it is common to use an underscore (_), not a hyphen (-), in Linux file names.

Last edited by frankbell; 01-06-2019 at 08:18 PM.
 
Old 01-06-2019, 11:57 PM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
spamassassin .cf files start with 10_, 20_, etc., but .cf, not .conf
dovecot .conf files in /etc/dovecot/conf.d/ match that pattern
Code:
find / -name 10-*conf -ls
will show you all files on your system that match that pattern.
 
Old 01-07-2019, 12:03 AM   #4
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Original Poster
Rep: Reputation: 72
Perhaps my question did not come across as intended. What I really need is to understand when to use 10-x, 20-x, etc..
 
Old 01-07-2019, 02:17 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by ilesterg View Post
Perhaps my question did not come across as intended. What I really need is to understand when to use 10-x, 20-x, etc..
priority?
10-x is prossessed before 20-x, etc.
 
2 members found this post helpful.
Old 01-07-2019, 05:10 AM   #6
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,830
Blog Entries: 17

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Quote:
Originally Posted by ondoho View Post
priority?
10-x is prossessed before 20-x, etc.
That's exactly it. Grub2 is a good example of this.. I doubt this is a naming/filesystem convention as oppose to just a pragmatic solution utilised by some, for some purpose.

Code:
ls /etc/grub.d/
 
Old 01-07-2019, 05:39 AM   #7
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
There are two main situations in which this kind of numbering takes place:

1) Programs that can process multiple configuration files need a way of coping with contradictions between them. A common rule is that later specifications override earlier ones. This in turn means that the files need to be processed in a particular order. Giving them a prefix number can ensure this, since files in a directory are always accessed in alphanumeric sorting order. Udev rules files work like this.

2) Sysvinit startup scripts also need to be processed in the correct order because many scripts depend on facilities that an earlier script has installed. So again, they have a sequence number for both startup (Snn) and shutdown (Knn).
 
3 members found this post helpful.
Old 01-10-2019, 07:03 PM   #8
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Original Poster
Rep: Reputation: 72
Quote:
Originally Posted by ondoho View Post
priority?
10-x is prossessed before 20-x, etc.
Thanks, and also thanks to Hazel. I guess I was just overthinking...
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to find and delete files by naming convention cp24eva Linux - General 3 07-08-2016 10:25 AM
[SOLVED] linux image naming convention entz Linux - Kernel 2 04-26-2012 03:49 PM
mail server the naming naming convention problem kashan Linux - Newbie 0 07-16-2004 02:08 PM
A small question in naming convention mnguyen Linux - Software 1 04-17-2004 03:14 AM
What is the naming convention for files in rcX.d? roshko Linux - Newbie 2 09-01-2003 04:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:51 PM.

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