What I noticed in the pam-mount logs was a line saying that "user A seems to have other remaining open sessions".
Paul Leiber (HE12026-03-01):
What I noticed in the pam-mount logs was a line saying that "user A seems to >> have other remaining open sessions".I would suggest to check:
- if the user still has processes running after they logged out;
- the ?session started? / ?session ended? (stopped?) in the systemd
logs.
There are no open processes of the user after logout. (The line <logout wait="2000" hup="0" term="1" kill="1"/> should have taken care of that anyway, if I am not mistaken.)
I still think that the problem lies with pmvarrun not being called to decrease the entry for a user at logout.
Here is an excerpt of my journal:
M„r 02 10:22:44 computer login[13770]: command: '/usr/sbin/pmvarrun' '-u' 'xxx'
M„r 02 10:22:44 computer login[13770]: (pam_mount.c:441): pmvarrun says login count is 17
M„r 02 10:22:47 computer login[13770]: command: '/usr/sbin/pmvarrun' '-u' 'xxx'
M„r 02 10:22:47 computer login[13770]: (pam_mount.c:441): pmvarrun says login count is 18
Paul Leiber (HE12026-03-02):I checked with ps -u username -U username after logging out, and it gave an empty result. Is there something else I could check?
There are no open processes of the user after logout. (The line <logoutYou might think that. But I have a slew of computers where KDE, and
wait="2000" hup="0" term="1" kill="1"/> should have taken care of that
anyway, if I am not mistaken.)
GNOME before that, leaves process lingering long after the user has
logged out, keeping the session nominally open. And filling up /var
because we log running process regularly.
It is on Ubuntu 22, it does not seem to happen on Trixie, but I have notThank you for the advice. I'll try to find a way to not localize the date in the future.
yet deployed it.
I still think that the problem lies with pmvarrun not being called toI have slightly different diagnostic. See below.
decrease the entry for a user at logout.
Here is an excerpt of my journal:Two pieces of advice about it:
- Avoid localizing the dates in your journal, especially if it causes
non-ASCII characters to be present. If you got that from journalctl,
then it was localized only when printing, so you need to worry about
it only when sharing excerpts like that.
As a general principle, localizing system messages means you can getI think this was Thunderbird, I think I have switched off line wrapping now.
confusing information from the message itself or from its
localization, not just from the message itself.
- Avoid line-rewrapping on log messages. I had to
`%s/> M„r.*\zs\n> \ze[^M]/` multiple times to read it properly.
For login:M„r 02 10:22:44 computer login[13770]: command: '/usr/sbin/pmvarrun' '-u' 'xxx'What I am seeing is pam called from login calling pmvarrun twice the
M„r 02 10:22:44 computer login[13770]: (pam_mount.c:441): pmvarrun says login count is 17
M„r 02 10:22:47 computer login[13770]: command: '/usr/sbin/pmvarrun' '-u' 'xxx'
M„r 02 10:22:47 computer login[13770]: (pam_mount.c:441): pmvarrun says login count is 18
same way with options `-u xxx`.
But in the source code, I see:
modify_pm_count(&Config, Config.user, "1");
in pam_sm_open_session() and
if (modify_pm_count(&Config, Config.user, "-1") > 0)
in pam_sm_close_session(), and it connects to:
{CMD_PMVARRUN, NULL, {"pmvarrun", "-u", "%(USER)", "-o", "%(OPERATION)", NULL}},
So what we should be seeing is:
command: '/usr/sbin/pmvarrun' '-u' 'xxx' '-o' '1'
command: '/usr/sbin/pmvarrun' '-u' 'xxx' '-o' '-1'
If pam-mount forgets the -o option, then it defaults to 1, and it would explain the mount count increasing each time.
But it needs to be confirmed, because it also could just be a bug / misfeature of the code that logs the command. There is an easy way to do
it: just before you valid your password, from another terminal, run as
root:
strace -f -s 10000 -e execve -p $(pidof login | tr ' ' ,) -o /tmp/strace_login
Translation:
strace ? dump the system calls done by processes;
-f ? including subprocesses after a fork;
-s 10000 ? with a very high limit to truncate strings and lists
-e execve ? only the system call that starts a new process
-p ? ? trace these processes
$(pidof login ?) ? theses processes = the login process
| tr ' ' , ? replace spaces with commas in case there are several
-o ? save the output in that file
Then you look at the file to see how pmvarrun is invoked.
If you see it invoked with the -o option, then it is a false lead andThe output matches the second description. I am not sure if I will be able to find the bug myself due to my limited knowledge, we'll see. In any case, would an appropriate next step be filing a bug report in the Debian bugtracker?
the issue is somewhere else.
If you see it invoked as shown in the logs, then we have surrounded the issue, and somebody needs to debug the source code to see where the -o
option gets lost. (But we have reached the limit of the investigating
that I was willing to do.)
Am 02.03.26 um 12:52 schrieb Nicolas George:
Paul Leiber (HE12026-03-02):I checked with ps -u username -U username after logging out, and it gave an empty result. Is there something else I could check?
There are no open processes of the user after logout. (The line <logoutYou might think that. But I have a slew of computers where KDE, and
wait="2000" hup="0" term="1" kill="1"/> should have taken care of that
anyway, if I am not mistaken.)
GNOME before that, leaves process lingering long after the user has
logged out, keeping the session nominally open. And filling up /var
because we log running process regularly.
Thank you for the advice. I'll try to find a way to not localize the date in the future.
It is on Ubuntu 22, it does not seem to happen on Trixie, but I have not
yet deployed it.
I still think that the problem lies with pmvarrun not being called toI have slightly different diagnostic. See below.
decrease the entry for a user at logout.
Here is an excerpt of my journal:Two pieces of advice about it:
- Avoid localizing the dates in your journal, especially if it causes
ÿÿ non-ASCII characters to be present. If you got that from journalctl,
ÿÿ then it was localized only when printing, so you need to worry about
ÿÿ it only when sharing excerpts like that.
ÿÿ As a general principle, localizing system messages means you can getI think this was Thunderbird, I think I have switched off line wrapping now.
ÿÿ confusing information from the message itself or from its
ÿÿ localization, not just from the message itself.
- Avoid line-rewrapping on log messages. I had to
ÿÿ `%s/> M„r.*\zs\n> \ze[^M]/` multiple times to read it properly.
For login:M„r 02 10:22:44 computer login[13770]: command: '/usr/sbin/pmvarrun' '-u' 'xxx'What I am seeing is pam called from login calling pmvarrun twice the
M„r 02 10:22:44 computer login[13770]: (pam_mount.c:441): pmvarrun says login count is 17
M„r 02 10:22:47 computer login[13770]: command: '/usr/sbin/pmvarrun' '-u' 'xxx'
M„r 02 10:22:47 computer login[13770]: (pam_mount.c:441): pmvarrun says login count is 18
same way with options `-u xxx`.
But in the source code, I see:
ÿÿÿÿmodify_pm_count(&Config, Config.user, "1");
in pam_sm_open_session() and
ÿÿÿÿif (modify_pm_count(&Config, Config.user, "-1") > 0)
in pam_sm_close_session(), and it connects to:
ÿÿÿÿÿÿÿÿ {CMD_PMVARRUN,ÿÿ NULL,ÿÿÿÿ {"pmvarrun", "-u", "%(USER)", "-o", "%(OPERATION)", NULL}},
So what we should be seeing is:
ÿÿÿÿcommand: '/usr/sbin/pmvarrun' '-u' 'xxx' '-o' '1'
ÿÿÿÿcommand: '/usr/sbin/pmvarrun' '-u' 'xxx' '-o' '-1'
If pam-mount forgets the -o option, then it defaults to 1, and it would
explain the mount count increasing each time.
But it needs to be confirmed, because it also could just be a bug /
misfeature of the code that logs the command. There is an easy way to do
it: just before you valid your password, from another terminal, run as
root:
strace -f -s 10000 -e execve -p $(pidof login | tr ' ' ,) -o /tmp/strace_login
Translation:
strace ? dump the system calls done by processes;
-f ? including subprocesses after a fork;
-s 10000 ? with a very high limit to truncate strings and lists
-e execve ? only the system call that starts a new process
-p ? ? trace these processes
$(pidof login ?) ? theses processes = the login process
| tr ' ' , ? replace spaces with commas in case there are several
-o ? save the output in that file
Then you look at the file to see how pmvarrun is invoked.
9414ÿ execve("/usr/sbin/pmvarrun", ["/usr/sbin/pmvarrun", "-u", "xxx"], 0x55ec223822c0 /* 11 vars */) = 0
For logout:
9483ÿ execve("/usr/sbin/pmvarrun", ["/usr/sbin/pmvarrun", "-u", "xxx"], 0x55ec223822c0 /* 17 vars */) = 0
The output matches the second description. I am not sure if I will be able to find the bug myself due to my limited knowledge, we'll see. In any case, would an appropriate next step be filing a bug report in the Debian bugtracker?
If you see it invoked with the -o option, then it is a false lead and
the issue is somewhere else.
If you see it invoked as shown in the logs, then we have surrounded the
issue, and somebody needs to debug the source code to see where the -o
option gets lost. (But we have reached the limit of the investigating
that I was willing to do.)
Thanks for your efforts, Nicolas, you helped me a lot!
Paul
| Sysop: | Jacob Catayoc |
|---|---|
| Location: | Pasay City, Metro Manila, Philippines |
| Users: | 5 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 121:18:14 |
| Calls: | 125 |
| Calls today: | 125 |
| Files: | 489 |
| D/L today: |
859 files (365M bytes) |
| Messages: | 76,611 |
| Posted today: | 26 |