You are not logged in.

#1 2024-05-06 17:56:56

vecino
Member
Registered: 2022-12-10
Posts: 139

[SOLVED] agetty: failed to open credentials directory

I found this in an already closed thread, but I didn't understand how to achieve turning off the warning.

https://bbs.archlinux.org/viewtopic.php?id=294465

seth wrote: Unsetting CREDENTIALS_DIRECTORY in the service environment should silence that but not change anything about the behavior, so not much to worry here.

My getty@tty1.service unit is here: https://0x0.st/s/EOlyKCipZcbbQ3WAwyh1Tg/X8io.service but I can't find CREDENTIALS_DIRECTORY there.



❯ systemctl status getty@tty1.service
● getty@tty1.service - Getty on tty1
     Loaded: loaded (/usr/lib/systemd/system/getty@.service; enabled; preset: enabled)
     Active: active (running) since Sun 2024-05-05 18:21:01 CEST; 1 day 1h ago
       Docs: man:agetty(8)
             man:systemd-getty-generator(8)
             https://0pointer.de/blog/projects/serial-console.html
   Main PID: 478 (agetty)
      Tasks: 1 (limit: 9458)
     Memory: 996.0K (peak: 1.9M)
        CPU: 16ms
     CGroup: /system.slice/system-getty.slice/getty@tty1.service
             └─478 /sbin/agetty -o "-p -- \\u" --noclear - linux

May 05 18:21:01 router systemd[1]: Started Getty on tty1.
May 05 18:21:01 router agetty[478]: failed to open credentials directory

Thanks

Last edited by vecino (2024-05-07 17:43:31)

Offline

#2 2024-05-06 21:01:35

seth
Member
Registered: 2012-09-03
Posts: 58,055

Re: [SOLVED] agetty: failed to open credentials directory

See the linked https://wiki.archlinux.org/title/Getty#Virtual_console - you'll have to augment the service (there's a sublink) and add "Environment=CREDENTIALS_DIRECTORY="
I guess the variable ise set by systemd at some point but this will (hopefully) override that.
Oetherwise you could wrap the actual Exec w/ env (I'll explain the details of that iff that becomes a necessity)

Online

#3 2024-05-07 16:21:44

vecino
Member
Registered: 2022-12-10
Posts: 139

Re: [SOLVED] agetty: failed to open credentials directory

I'm not sure if I got it right, but I tried two ways.

1) I created a file /etc/systemd/system/getty@tty1.service.d/autologin.conf and put into it:

[Service]
Environment=CREDENTIALS_DIRECTORY=

2) systemctl edit --full getty@tty1.service and there I also added Environment=CREDENTIALS_DIRECTORY= .


systemctl daemon-reload + systemctl restart getty@tty1.service

But the result is still the same:

May 07 18:12:43 router agetty[14965]: failed to open credentials directory

Offline

#4 2024-05-07 16:30:34

seth
Member
Registered: 2012-09-03
Posts: 58,055

Re: [SOLVED] agetty: failed to open credentials directory

https://man.archlinux.org/man/core/syst … NVIRONMENT

UnsetEnvironment=CREDENTIALS_DIRECTORY

Edit: "autologin.conf" isn't maybe the greatest name for this drop-in wink

Last edited by seth (2024-05-07 16:31:44)

Online

#5 2024-05-07 16:48:25

vecino
Member
Registered: 2022-12-10
Posts: 139

Re: [SOLVED] agetty: failed to open credentials directory

I have to learn, I have to learn, I have to learn... big_smile

@seth - you're the best - once again you've given me excellent advice for the umpteenth time... the annoying catchphrase is gone. Thak you!

autologin.conf -> spam.conf

Offline

#6 2024-05-07 16:53:24

seth
Member
Registered: 2012-09-03
Posts: 58,055

Re: [SOLVED] agetty: failed to open credentials directory

We all learn as we go - I had no idea how to unset environment variables in systemd services until now, thanks to you, I do cool

Online

#7 2024-05-07 17:42:59

vecino
Member
Registered: 2022-12-10
Posts: 139

Re: [SOLVED] agetty: failed to open credentials directory

If anyone was looking for a final solution:

Just create a directory /etc/systemd/system/getty@tty1.service.d and place any .conf name in it and paste it in:

[Service]
UnsetEnvironment=CREDENTIALS_DIRECTORY

after that run: systemctl daemon-reload + systemctl restart getty@tty1.service

done - failed to open credentials directory message is gone

Offline

#8 2024-05-07 20:26:05

seth
Member
Registered: 2012-09-03
Posts: 58,055

Re: [SOLVED] agetty: failed to open credentials directory

You might want to

sudo systemctl edit getty@.service 

to override all getty's this way.

Online

#9 2024-05-07 21:05:44

vecino
Member
Registered: 2022-12-10
Posts: 139

Re: [SOLVED] agetty: failed to open credentials directory

Yes, that's how it works too. I would just add --full.

systemctl edit --full getty@tty1.service

I'm just not sure it'll survive the update util-linux package.

Offline

#10 2024-05-07 21:08:26

seth
Member
Registered: 2012-09-03
Posts: 58,055

Re: [SOLVED] agetty: failed to open credentials directory

I would just add --full

Why? Using a drop-in would survive any update for sure.

Online

#11 2024-05-07 21:19:50

vecino
Member
Registered: 2022-12-10
Posts: 139

Re: [SOLVED] agetty: failed to open credentials directory

Ok - my ignorance again. Then it's the perfect solution. Thanks again.

Offline

#12 2024-05-07 21:29:55

vecino
Member
Registered: 2022-12-10
Posts: 139

Re: [SOLVED] agetty: failed to open credentials directory

Ah, I only just understood your post seth. Until now I thought I always had to edit the unit with --full, otherwise it wouldn't save.

❯ systemctl edit getty@.service
Successfully installed edited file '/etc/systemd/system/getty@.service.d/override.conf'.

But it doesn't apply to the drop-in.

### Editing /etc/systemd/system/getty@.service.d/override.conf
### Anything between here and the comment below will become the contents of the drop-in file

Offline

Board footer

Powered by FluxBB