Bug 36543 - Setup cleanup scripts are not executed
Setup cleanup scripts are not executed
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: System setup
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0
Assigned To: Alexander Kläser
Stefan Gohmann
: interim-4
: 36612 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-10 16:15 CET by Stefan Gohmann
Modified: 2014-11-26 06:54 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
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?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2014-11-10 16:15:01 CET
Not all setup cleanup scripts are executed. I didn't get the registration email:

=== DONE (2014-11-10 09:54:22) ===



=== Cleanup (2014-11-10 09:59:38) ===


=== Running cleanup-pre scripts (2014-11-10 09:59:38) ===

=== done (2014-11-10 09:59:38) ===
Restarting Univention Management Console Server.
done.
Restarting Univention Management Console Web Server.
done.
Restarting web server: apache2 ... waiting .

=== Running cleanup-post scripts (2014-11-10 09:59:43) ===
= Running 10_disable_system_setup_wizard
Create umc/module/setup/wizard/disabled
= Running 10_disable_univention-system-setup-boot
Setting system/setup/boot/start
= Running 10_notifier_listener_restart
Restarting univention-directory-notifier daemon: .
Comment 1 Florian Best univentionstaff 2014-11-10 16:30:53 CET
hmm, strange.. do you still have the system where it happened?
Comment 2 Stefan Gohmann univentionstaff 2014-11-10 16:32:45 CET
(In reply to Florian Best from comment #1)
> hmm, strange.. do you still have the system where it happened?

10.201.50.1
Comment 3 Alexander Kläser univentionstaff 2014-11-10 17:52:06 CET
I moved the cleanup function into a separate script which gets called with an at job (using univention.lib.atjobs). The package dependencies should be fine, AFAIS. In my test, I could call the script via UMC command (see output below:

-------------------- 8< --------------------
=== Cleanup (2014-11-10 17:44:34) ===

=== Running cleanup-pre scripts (2014-11-10 17:44:34) ===

=== done (2014-11-10 17:44:34) ===
Restarting Univention Management Console Server.
done.
Restarting Univention Management Console Web Server.
done.
Restarting web server: apache2 ... waiting .

=== Running cleanup-post scripts (2014-11-10 17:44:43) ===
= Running 10_disable_system_setup_wizard
Create umc/module/setup/wizard/disabled
= Running 10_disable_univention-system-setup-boot
Setting system/setup/boot/start
= Running 10_notifier_listener_restart
Restarting univention-directory-notifier daemon: .
ok: run: univention-directory-notifier: (pid 10440) 0s, normally down
done.
Restarting univention-directory-listener daemon.
ok: run: univention-directory-listener: (pid 10478) 0s, normally down
done.
= Running 20_amavis_restart
= Running 30_activate_license
= Running 99_remove_univention_system_setup_boot

=== done (2014-11-10 17:44:56) ===

=== DONE (2014-11-10 17:44:56) ===
-------------------- 8< --------------------

BTW, the script 10_notifier_listener_restart takes some time for restarting the notifier services, that is why the scripts where stopped there previously.

univention-system-setup (8.1.57-1):
* Bug #36543: call cleanup functionality via a separate script as at job;
  this avoids the current module process being killed upon UMC restart
Comment 4 Stefan Gohmann univentionstaff 2014-11-11 09:08:57 CET
After clicking on 'Finish' in the system setup part of the installer, I get a UMC login and nothing happens.
Comment 5 Alexander Kläser univentionstaff 2014-11-11 13:12:47 CET
(In reply to Stefan Gohmann from comment #4)
> After clicking on 'Finish' in the system setup part of the installer, I get
> a UMC login and nothing happens.

-------------------- 8< --------------------
tail -f /var/log/univention/management-console-*log
[...]
==> /var/log/univention/management-console-server.log <==
11.11.14 13:08:33.083  PARSER      ( INFO    ) : UMCP REQUEST 141570771306351-700 parsed successfully
11.11.14 13:08:33.083  MAIN        ( INFO    ) : Incoming request of type COMMAND
11.11.14 13:08:33.083  RESOURCES   ( INFO    ) : Searching for module providing command setup/cleanup
11.11.14 13:08:33.083  RESOURCES   ( INFO    ) : Found module setup
11.11.14 13:08:33.083  MAIN        ( INFO    ) : Passing new request to running module setup
11.11.14 13:08:33.083  PROTOCOL    ( INFO    ) : Sending UMCP COMMAND REQUEST 141570771306351-700

==> /var/log/univention/management-console-module-setup.log <==
11.11.14 13:08:33.083  PARSER      ( INFO    ) : UMCP REQUEST 141570771306351-700 parsed successfully
11.11.14 13:08:33.083  MODULE      ( INFO    ) : Received request 141570771306351-700
11.11.14 13:08:33.083  PROTOCOL    ( INFO    ) : Received UMCP COMMAND REQUEST 141570771306351-700
11.11.14 13:08:33.083  MODULE      ( INFO    ) : Executing ['setup/cleanup']
11.11.14 13:08:33.083  MODULE      ( INFO    ) : Appliance mode: cleanup
11.11.14 13:08:33.083  PROTOCOL    ( INFO    ) : Sending UMCP RESPONSE 141570771306351-700

==> /var/log/univention/management-console-server.log <==
11.11.14 13:08:33.086  PARSER      ( INFO    ) : UMCP RESPONSE 141570771306351-700 parsed successfully
11.11.14 13:08:33.086  PROTOCOL    ( INFO    ) : Received UMCP RESPONSE 141570771306351-700

==> /var/log/univention/management-console-web-server.log <==
11.11.14 13:08:33.086  PARSER      ( INFO    ) : UMCP RESPONSE 141570771306351-700 parsed successfully
11.11.14 13:08:33.087  PROTOCOL    ( INFO    ) : Received UMCP RESPONSE 141570771306351-700
11.11.14 13:08:33.087  MAIN        ( INFO    ) : SessionClient(0x2e13690): got response(141570771306351-700): status=200 queue=0x2e23b00
11.11.14 13:08:33.087  MAIN        ( INFO    ) : CPCommand (127.0.0.1:58406) got response(0x2e13f50) from queue(0x2e23b00): status=200 (sessionid="1db13b6b-6940-42bd-b521-9a476b85a387")

==> /var/log/univention/management-console-module-setup.log <==
11.11.14 13:08:33.197  MODULE      ( INFO    ) : ... cleanup done
^C
root@unassigned-hostname:~# atq 
1       Tue Nov 11 13:08:00 2014 a root
root@unassigned-hostname:~# date
Di 11. Nov 13:09:21 CET 2014
-------------------- 8< --------------------

It seems that the at job is scheduled, but not executed.
Comment 6 Alexander Kläser univentionstaff 2014-11-11 13:38:34 CET
(In reply to Alexander Kläser from comment #5)
> ...
> It seems that the at job is scheduled, but not executed.

atd was not running. The service will be started now explicitely in setup-join.sh [r55646].

Added changelog entry [r55648].

univention-system-setup (8.1.57-2):
* Bug #36543: make sure that atd is running before performing cleanup
Comment 7 Stefan Gohmann univentionstaff 2014-11-12 07:53:59 CET
(In reply to Alexander Kläser from comment #6)
> (In reply to Alexander Kläser from comment #5)
> > ...
> > It seems that the at job is scheduled, but not executed.
> 
> atd was not running. The service will be started now explicitely in
> setup-join.sh [r55646].

Sorry, but it doesn't work in my tests.
Comment 8 Alexander Kläser univentionstaff 2014-11-12 12:59:33 CET
(In reply to Stefan Gohmann from comment #7)
> (In reply to Alexander Kläser from comment #6)
> > atd was not running. The service will be started now explicitely in
> > setup-join.sh [r55646].
> 
> Sorry, but it doesn't work in my tests.

True! A thorough investigation revealed that the cause for this unexpected behaviour was a system reboot which is performed at the end of the Debian Installer procedure. This had also killed the cleanup at job.

I made several changes now.
* The removal of USS-boot is carried out at the end of setup-join.sh as appliance hook script. This avoids a possibly fairly long procedure as part of the clean up scripts (in case univention-kde is not installed).
* All cleanup steps (also UMC restart + shutdown of the local browser) are now carried out as separate scripts. This makes what is happening a bit more transparent.
* The listener and notifier services are not restarted during an installation (the reboot is done anyway).
* In the UMC frontend, no redirect is carried out (in case the cleanup takes a bit longer), instead the progress bar is shown indefinitely long (i.e., until the shutdown of the browser).

All should be good now :) .


univention-system-setup (8.1.58-1):
Bug #36543:
* move steps from cleanup.py into cleanup scripts
* adjust order of cleaning up scripts, shut down browser at the very end
  (as the Debian Installer will perform a reboot)
* wait indefinitely in UMC during local mode after sending cleanup command
Comment 9 Stefan Gohmann univentionstaff 2014-11-12 18:48:08 CET
(In reply to Alexander Kläser from comment #8)
> All should be good now :) .

Yes, it works now. ;)
Comment 10 Philipp Hahn univentionstaff 2014-11-13 13:04:24 CET
*** Bug 36612 has been marked as a duplicate of this bug. ***
Comment 11 Stefan Gohmann univentionstaff 2014-11-26 06:54:55 CET
UCS 4.0-0 has been released:
 http://docs.univention.de/release-notes-4.0-0-en.html
 http://docs.univention.de/release-notes-4.0-0-de.html

If this error occurs again, please use "Clone This Bug".