Linux doesnt see most file extensions - there are some exceptions. Is smb.conf one of them? Linux n00b


It can be renamed to smb.bak for a backup so Im presuming its one of the exceptions.

I speed read Linux doesnt need most file extensions but dont recall it all.  Can you explain why it hasnt and how it manages without the need extensions like windows?

Thanks
fcekAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

farzanjCommented:
Unlike Windows, Linux does NOT care about your file extensions.  You can make files without ANY extension, you can make file with names like name.longextension and you can also make like this.is.my.file.  It does not categorize files like that.

One way Linux does is by -- analyzing file type.

So if you do

file <filename>

It would tell you the file type.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
farzanjCommented:
Conf is also no exception.  It is just to make it readable to you.  If you wish, you can make extensions like txt or .dat or whatever.  But as I said, the OS would not classify it with the extension names.  It would do it as you see in the file command
0
DileepanCommented:
It is the file content that makes the difference here. Also, permissions attached to file (ls -l listing) tells you, if the same can be executed, read, updated.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

tsmgeekCommented:
samba will always look for smb.conf as its starting file, after that you can include any filename from within smb.conf to extend it
0
fcekAuthor Commented:

So how does samba know which file to read?  The first two are backups

-rw-r--r--    1 root root 12672 Mar  8 18:04 smb.bak
-rw-r--r--.   1 root root 11831 Mar  7 22:17 smb.bk
-rw-r--r--    1 root root 15043 Mar 23 02:10 smb.conf
0
fcekAuthor Commented:
0
farzanjCommented:
It is included in the binary -- the programmer wrote it this way.

if you get the source code and change the name to fcek.configuration, you can.

I would like you to issue this command as root
 
strings $(which smbd) | grep smb.conf

Open in new window


The above command shows you the string contents of the binary, which the information is stored as to which file it is supposed to read.

In Unix/Linux some times there environment variables setting the names of files to be checked.
0
tsmgeekCommented:
its not directly written by the programmer, when the program is compiled there is an option to specify where the config file is, some users like it in /etc/samba/ others in /usr/local/etc/ etc etc, it can be overriden though by a file in /etc/sysconfig/samba, you add -s smb.xxx etc to the start params
0
farzanjCommented:
Well pointed out by tsmgeek.

I didn't want to go into these details-- typical programming practices are to keep various values configurable at various levels, by using install options, etc.

Yes I changed to line in /etc/sysconfig/samba to read as
SMBDOPTIONS="-D -s /etc/samba/smb.config"

And now it reads from the above mentioned file, as its config file.
Thanks tsmgeek for pointing at out.  Nonetheless, the binary contained the name of file as I mentioned above and the command.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.