[OpenAFS] Check free space on AFS share before login

Stephan Wiesand stephan.wiesand@desy.de
Wed, 1 Feb 2017 13:07:30 +0100

Hi Michael,

> On 1 Feb 2017, at 11:08, Richter, Michael <m.richter@tu-berlin.de> =
> Hi,
> we are using  OpenAFS for the home drive. /home/users is a symlink to =
the AFS path with all the home shares. The users home is for example =
> =20
> The users only have 1 GB of space available in that share. It often =
happens that the quota is reached and they are unable to login. Ubuntu =
doesn=E2=80=99t give a meaningful error message. I think, Ubuntu =
doesn=E2=80=99t know what=E2=80=99s the problem, because it sees only =
=E2=80=9C/=E2=80=9D as mountpoint, which has enough free space =
> =20
> Is there a way to check the free space of the user on login and give =
the user a good error message if there is not enough free space =
available in the AFS share?

nice idea... I should probably implement that here. Something like

auth required pam_exec.so stdout /bin/check_home_space

should work well enough at least with lightdm. Just make the script =
print a short message to stdout and exit 1 in the failure case.


> =20
> I think about using pam-script to run a script that checks it but I =
can=E2=80=99t see a way to bring back that message to the user. Also =
pam-afs-session seems not to have some option for that. Is there some =
other solution?
> =20
> Greetings
> Michael

Stephan Wiesand
Platanenallee 6
15738 Zeuthen, Germany