Linux .conf File and .conf.d Directory Confusion (... and Finding More about LightDM Configuration / Documentation)

sphen

Well-Known Member
Joined
Dec 12, 2022
Messages
871
Reaction score
753
Credits
10,429
I decided to full upgrade an Ubuntu MATE from 18.04 LTS to 22.04.1 LTS. That meant multiple upgrades, first to 20.04, then 22.04.1. I used the Software Updater application, not the command line based on a coin toss. Ubuntu MATE uses LightDM as the display manager.

When the first upgrade completed, I noticed that the Guest login reappeared. When I looked for /etc/lightdm/lightdm.conf, it was gone. It had been replaced by the file /etc/lightdm/users.conf and a directory /etc/lighdm/lighdm.conf.d. The lightdm.conf.d directory contains three files: "90-arctica-greeter.conf", "91-arctica-greeter-guest-session.conf" and "91-arctica-greeter-mate.conf". Note that two of the files start with "91".

I am used to editing lightdm.conf as a single file. LightDM is not the only configuration that has changed over time from a .conf file to a .conf.d directory structure. Sometimes the name-matching xxxxx.conf file and xxxxx.conf.d are both in a directory. (Yes, I have seen other ".d" directories and edited files in them, but followed the pattern without a real understanding. Network configuration files changed a long time ago to a similar format in some versions, but I never fully understood the workings of those changes. That is what I am asking about now.)

My normal habit is to copy the file to back it up just in case. I append ".org" to the copy, then edit the .conf file.

Here are my questions:

1. Where can I find links or documentation regarding how those configuration directories work?
What I am struggling with is that they seem to be processed in filename order. In the new LightDM, two of the filenames start with the same numerical prefix. Do all xxxxx.conf.d directories work the same? How are multiple files with the same prefix read or skipped or is the prefix ignored and all files are read in sort order? How do they handle multiple files with overlapping or duplicate configuration entries?
-> Will ".org" files be read and interpreted from those xxxxx.conf.d directories?

2. Where can I find links or documentation regarding the various configuration settings for LightDM configuration files? Could they be distro-specific?

3. And ... What obvious things am I missing or failing to understand?
 


This may be TL;DR for some, but the OP may find parts of it of interest. :)

When I looked for /etc/lightdm/lightdm.conf, it was gone. It had been replaced by the file /etc/lightdm/users.conf and a directory /etc/lighdm/lighdm.conf.d.

Not replaced, in the terms of

/etc/lightdm/lightdm.conf.d

Mine is dated 22-Mar-2018 , which means it was there with the original install of 18.04, released 4 weeks later. The same applies to /etc/lightdm/users.conf also dated the same.

System files ending in d and folders ending in .d indicate the presence of Daemons. Daemons run for the duration of your session. They are not unique to Linux, email servers use daemons ("You've Got Mail" and "Postmaster cannot find this address").

https://itsfoss.com/linux-daemons/

and

https://man7.org/linux/man-pages/man7/daemon.7.html

explain more.

Arctica Greeter - the following does not explain a lot, but it came in with Jammy (22.04), I think, although there are earlier references.

https://manpages.ubuntu.com/manpages/focal/en/man8/arctica-greeter-guest-account-script.8.html

A search on

what is arctica greeter

will reveal more.

If they follow the same pattern as shell scripts housed in /etc/grub.d/

Code:
00_header        10_linux_zfs  30_uefi-firmware  41_custom
05_debian_theme  20_linux_xen  35_fwupd          README
10_linux         30_os-prober  40_custom

then they are executed in numerically ascending order first, and then likely by alphabetical order of name.

Our Lubuntu/Ubuntu people, David G. @KGIII and Chris Guiver @guiverc may have more information in this regard, or correct anything I have said which is incorrect.

Wizard
 
@wizardfromoz: Thanks for getting back to me. I know about daemons, but this is really about the configuration files that they read for their settings. Here is a better summary of my questions:

1. Are the configuration files processed in a particular order?
(Answer: Yes, by WizardFromOz, above. He says that they are in numeric first, then alphabetical by name.)
-> My hunch is that it is Linux filename order, which should be equivalent.

2. Are all of the .d (conf.d) configuration directories processed the same way? Is there a common standard for them?
-> Awaiting answer from someone here.

3. Are filenames other than .conf read? (In other words, if I leave my backup ".org" copies in the directories, will they be processed?)
-> Awaiting answer from someone here.
 
sphen wrote:
I am used to editing lightdm.conf as a single file. LightDM is not the only configuration that has changed over time from a .conf file to a .conf.d directory structure. Sometimes the name-matching xxxxx.conf file and xxxxx.conf.d are both in a directory. (Yes, I have seen other ".d" directories and edited files in them, but followed the pattern without a real understanding.

wizardfromoz wrote:
System files ending in d and folders ending in .d indicate the presence of Daemons. Daemons run for the duration of your session.

In the olden days when linux systems were a bit smaller, configuration files in /etc were often just /etc/<program>.conf, such as /etc/modules.conf, /etc/sysctl.conf, /etc/rsyslog.conf, and those were the only configuration files for those processes. Later, for some of these the configuration options expanded by using a directory in which configurations could also be written, so then there appeared /etc/sysctl.d/, /etc/rsyslog.d/, /etc/logrotate.d/ and in the case of modules, /etc/modprobe.d/, /etc/modules-load.d/, so both name changes and directories were introduced using the suffix .d. That .d thus was an indication of a directory in which configurations could be made either in the original /etc/<program>.conf file, or the files in the /etc/<program>.d/ directory.

These configuration files do not ordinarily contain daemons which run in the background. It's a different letter d that is used for daemons where the letter d is attached to the program names without the dot, like: sshd, named, httpd, lpd etc., to indicate their daemon status.

These days, some programs use the /etc/<program>.conf file as a the default configuration file, and suggest that user configurations can be placed in the /etc/<program>.d/ file, often using a filename with the format: <number>-<name>.conf, but this varies. Information is sometimes given such as in the README file in the /etc/sysctl.conf.d/README.sysctl file:
Files found under the /etc/sysctl.d directory that end with .conf are parsed within sysctl(8) at boot time. If you want to set kernel variables you can either edit /etc/sysctl.conf or make a new file.
The reference to "make a new file" is to make the new file in that directory, /etc/sysctl.conf.d/ where the README file resides.
 
Last edited:
Thanks @osprey for that clarification, you said it better (and more accurately) than I could have. :)

@sphen is there something you wish to add to or alter in a lightdm.conf to enhance your work environment?

Why I ask is that I have been working my way through 30 to 40 of my distros which use LightDM, to improve my login screen and desktop session with regard to
  • numlock being switched on from the time of being in the login screen and through the desktop session
  • Larger text (I wear reading glasses) using HiDPI (similar to fractional scaling) and
  • Larger mouse cursor including at the login screen
and may be of assistance.

You can also gain more functionality in your LightDM distro by adding (if not already installed) the following 2 packages

lightdm-gtk-greeter
lightdm-gtk-greeter-settings

If that is the case, then start a new thread on the subject and I will swing by.

Cheers

Wizard
 
Thanks @osprey for that clarification, you said it better (and more accurately) than I could have. :)

@sphen is there something you wish to add to or alter in a lightdm.conf to enhance your work environment?
[...] Cheers, Wizard
Thanks to @osprey for the clarification and thank you to @wizardfromoz for the offer, but I am okay for now. I don't customize very much, but I like to disable the Guest login prompt.

I started this thread after upgrading an Ubuntu MATE 18.04 desktop. After the first upgrade to 20.04, the Guest login prompt reappeared. I investigated, and assumed that /etc/lightdm/lightdm.conf had been deleted. In its place were user.conf and the lightdm.conf.d directory.
Added later, before posting:
I assumed that the "deleted" lightdm.conf file had my change that eliminated the Guest login prompt.
-> The lighdm.conf file probably never existed, see the update below.


That is what took me down the rabbit hole of the configuration directories. I must be remembering the days when most configuration settings were solely in /etc/*****.conf files rather than the newer directory approach.

I understand the difference between daemon files whose names generally end with the letter "d" and the configuration directories whose names end with ".d".

In general, I can usually find task-specific information online. Where I generally need help is finding resources to fill the holes in that foundational knowledge that many people take for granted. You know, the kind that comes with long experience.

- - - - -
Update, written later, before posting:

I tried replicating what happened, but could not. Now I question my own memory of what I had before upgrading. In addition, I probably approved a file replacement during the upgrade. Here is what I tried and learned:
  • Installed Ubuntu MATE 18.04.5 from download. The /etc/lightdm/ directory had the users.conf file and lightdm.d directory as the upgraded systems I had seen before.
  • Installed Ubuntu MATE 18.04 from download. I thought that perhaps an older version of 18.04 would have the old lightdm.conf file. It did not. I found the same users.conf file and lightdm.d directory.
  • I modified the /etc/lightdm/users.conf file in the 18.04 installation and eliminated the Guest login prompt. (The setting is "allow-guest=false".)
  • I upgraded the 18.04 to 20.04 and bingo!- a dialog box asking, "Replace the customized configuration file /etc/lightdm/users.conf?" and showing a diff of my file and the proposed replacement.
    • I do not remember seeing that dialog box during the original upgrade, but I bet it appeared.
    • I do not remember clicking "Replace" in that dialog box that "may have appeared", but I bet I did that too. :-(
The mystery has been solved to my satisfaction, and I have a much better understanding of how those configuration directories work.


(Related: I remember a presentation where the speaker talked about how users "swat away dialog boxes like flies off the screen." Circumstantial evidence indicates that I am not immune.)
 
Last edited:

Members online


Top