Significance of KeyringMode in an unit file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I am interested in knowing more about defining the `KeyringMode=` in a systemd unit file especially when combined with `User=`.

I read the official doc: https://www.freedesktop.org/software/systemd/man/systemd.exec.html#KeyringMode=

However, I wasn't able to understand the doc completely. I am more interested in knowing about the `shared` mode. I had a few questions based on the following snippet of systemd unit file:

     ExecStartPre=<prompt password using systemd-ask-password and put it on user keyring (@u)>
     ExecStart=<start main program>
     User=<user>
     KeyringMode=shared

Here, <user> is similar to `jenkins`, which doesn't have a login shell and <main program> reads the kernel keyring for the password.

IIUC, following takes place:
1. ExecStartPre starts as <user> process with a PID: pid1
2. ExecStart starts as <user> process with a PID: pid2

Q1. Between 1 & 2, since there is no active <user> process, will the user keyring be dropped or will it survive?
Q2. What is the significance of `KeyringMode=shared` here? Does it apply to keyring @u or just to @s keyring?

Regards,
Dinesh

_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux