Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User configuration #819

Open
ModProg opened this issue Oct 25, 2023 · 1 comment
Open

User configuration #819

ModProg opened this issue Oct 25, 2023 · 1 comment

Comments

@ModProg
Copy link

ModProg commented Oct 25, 2023

I'm unsure if this might be a non-goal of augeas, but I didn't read anything on this in the readme.

Example:

augtool> ls /files/etc/systemd/system/a.service
Unit/ = (none)
Service/ = (none)
augtool> ls /files/home/modprog/.config/systemd/user/a.service
augtool>

The identical file was placed in both locations. AFAICT this is not systemd specific, as none of the paths in https://augeas.net/stock_lenses.html mention home.

@georgehansper
Copy link
Member

augeas loads a lot of files on startup, but not everything on the filesystem

Each lens (*.aug) includes a list of files and patterns which it will load automatically.
A small number of lenses will load files from the users home directory, but even that may not be what you are looking for

It is possible to tell augtool exactly which file to load, and which lens to use, eg.

augtool --noload
augtool> transform Systemd incl /home/modprog/.config/systemd/user/a.service
augtool> load-file /home/modprog/.config/systemd/user/a.service
augtool> ls /files/home/modprog/.config/systemd/user/a.service
...

(you don't really need to use --noload it just makes the startup a bit faster)

I hope that helps

If you have augeas 1.14.0 or later, you can use augprint to print the required transform, load-file and example set statements for your particular use-case:

augprint --lens Systemd /home/modprog/.config/systemd/user/a.service

The --lens argument will use the specified lens and does not require it to be hard-coded into the *.aug lens file

I don't think the augeas.net website is being updated with any regularity. Please refer to the lens file itself if in doubt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants