Bug 46720 - (4.2) Exam mode should not remove exam users home directory
(4.2) Exam mode should not remove exam users home directory
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
UCS@school 4.1 R2
Other Linux
: P5 normal (vote)
: UCS@school 4.2 v8
Assigned To: Sönke Schwardt-Krummrich
Jürn Brodersen
:
Depends on: 46719
Blocks: 39427 44157
  Show dependency treegraph
 
Reported: 2018-03-21 16:50 CET by Sönke Schwardt-Krummrich
Modified: 2018-04-06 22:09 CEST (History)
0 users

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2018-03-21 16:50:21 CET
In a first step, the removal of the exam user's home directory shall be avoided by setting a UCR variable. The listener module will then move the exam user's home directory to the default backup directory.

+++ This bug was initially created as a clone of Bug #39427 +++

When stopping the exam mode, the home directory of the exam users is removed directly after collecting the exam files. There has been at least one case, where the students have saved their results not within the exam folder but in the root of their exam user home directory. The teacher stopped the exam and the results were lost.

Possible solution:
- do not remove exam user's home directory via UMC module
- after removing the user, the listener module remove-old-homedirs.py moves the 
  exam home directory to the backup directory (default: /home/backup)
- add an adjustable cronjob that checks the backup directory for "outdated" exam 
  home directories and removes them ("outdated" means e.g. "older than 8 days").

Possible Extension:
- the cron job should also check the other backed up home directories and remove 
  outdated directories (with different expiration date).
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2018-03-22 12:59:07 CET
As a first step, the exam module was modified in such a way that optionally
(controllable via a UCR variable) the home directory of the exam users is
*not* deleted at the end of the class work.

If deletion is disabled, the exam mode will behave as follows:
If the user has logged off correctly from the Windows client, the results
are copied from the home directory to the results directory of the teacher.
After the deletion of the home directory has been skipped, the exam user
is deleted in LDAP.

By default, the listener module remove-old-homedirs.py is now active, which
automatically moves the home directories of deleted users to /home/backup/
and appends a Unix timestamp to the directory name:

/home/gsmitte/schueler/exam-homes/exam-edo.kaiser.20180310-032742
→
/home/backup/exam-edo.kaiser.20180310-032742.1521713195

The new boolean UCR variable is:
ucsschool/exam/user/homedir/autoremove

By default, this variable is set to "yes" by the postinst script.

Please note:
If the user logs off from the Windows client after the exam mode has
ended and there is still a running connection between Samba and the Windows
client, the Samba process recreates the home directory of the Exam user and
saves the Windows profile there. This is usually done after the listener
module has already moved the actual home directory to /home/backup/. In this
case, both directories (/home/backup/$EXAMUID.$EXAMTIMESTAMP.$BACKUPTIMESTAMP
and /home/$OU/schueler/exam-homes/$EXAMUID.$EXAMTIMESTAMP) have to be checked,
if, for example, the results you are looking for are not in the results
directory of the teacher.

PLEASE NOTE: all commits have been done with bug number 46719!

Package: ucs-school-umc-exam
Version: 7.0.4-20A~4.2.0.201803221254

abed9a08 Bug #46710, #46709, #46719, #46720: Merge branch 'sschwardt/46710/42/file_upload' into 4.2
0b7c9787 Bug #46719: add advisory
43baa90c Bug #46719: add changelog entry
a3823253 Bug #46719: add UCR variable to disable the automatic removal of the home directories of exam users
Comment 2 Jürn Brodersen univentionstaff 2018-03-23 08:31:00 CET
The english description for the ucr variable sounds wrong. 
check user -> exam user?
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2018-03-23 10:37:57 CET
(In reply to Jürn Brodersen from comment #2)
> The english description for the ucr variable sounds wrong. 
> check user -> exam user?

Yep, you're right. Fixed.

5d158f55 Bug #46719: updated advisory
eeca5c93 Bug #46719: add changelog entry
ff3a4262 Bug #46719: fix UCR variable description

Package: ucs-school-umc-exam
Version: 7.0.4-21A~4.2.0.201803231033
Comment 4 Jürn Brodersen univentionstaff 2018-03-23 11:01:48 CET
Ok
What I tested:
ucsschool/exam/user/homedir/autoremove=yes -> home directories are removed and NOT moved into /home/backups -> OK
ucsschool/exam/user/homedir/autoremove=no -> home directories are removed and moved into /home/backups -> OK

YAML -> OK

-> Verified
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2018-04-06 22:09:06 CEST
UCS@school 4.2 v8 has been released.

https://docs.software-univention.de/changelog-ucsschool-4.2v8-de.html

If this error occurs again, please clone this bug.