Bug 33729

Summary: Add cleanup hook directories
Product: UCS Reporter: Erik Damrose <damrose>
Component: System setupAssignee: Erik Damrose <damrose>
Status: CLOSED FIXED QA Contact: Felix Botner <botner>
Severity: normal    
Priority: P5 CC: botner, jmm
Version: UCS 3.2   
Target Milestone: UCS 3.2-0-errata   
Hardware: Other   
OS: Linux   
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:

Description Erik Damrose univentionstaff 2013-12-11 15:47:39 CET
While creating UCS appliances it became apparent that we need a way to execute hook scripts in the cleanup phase, before and after the appliance-only network interface is removed.

The following hook directories will be added and scripts in them executed during the cleanup:
/usr/lib/univention-system-setup/cleanup-pre.d
/usr/lib/univention-system-setup/cleanup-post.d
Comment 1 Erik Damrose univentionstaff 2013-12-13 15:03:19 CET
* Add cleanup -pre and -post hookdirectories
* Added a notifier and listener restart script to be executed after
appliance setup cleanup.

r46744 univention-system-setup 7.0.66-6.555.201312131458
2013-11-27-univention-system-setup.yaml
Comment 2 Felix Botner univentionstaff 2013-12-16 16:50:26 CET
OK

/var/log/univention/setup.log:
=== Running cleanup-pre scripts (2013-12-16 16:42:54) ===
Running 20_my
=== done (2013-12-16 16:42:54) ===

=== Running cleanup-post scripts (2013-12-16 16:42:58) ===
Restarting univention-directory-notifier daemon: ...
Restarting univention-directory-listener daemon...
Running 10_notifier_listener_restart
Running 20_my
=== done (2013-12-16 16:43:11) ===

-> more /tmp/log.log 
Mo 16. Dez 16:42:54 CET 2013
cleanup-pre.d
/usr/lib/univention-system-setup/cleanup-pre.d/20_my
Mo 16. Dez 16:43:11 CET 2013
cleanup-post.d
/usr/lib/univention-system-setup/cleanup-post.d/20_my

-> more /usr/lib/univention-system-setup/cleanup-post.d/20_my 
#!/bin/bash
date >>/tmp/log.log
echo "cleanup-post.d" >>/tmp/log.log
echo $0 >>/tmp/log.log

-> more /usr/lib/univention-system-setup/cleanup-pre.d/20_my 
#!/bin/bash
date >>/tmp/log.log
echo "cleanup-pre.d" >>/tmp/log.log
echo $0 >>/tmp/log.log

OK - YAML
Comment 3 Erik Damrose univentionstaff 2013-12-17 09:31:25 CET
REOPEN -> output during cleanup is in wrong order (first the script output is seen, then the name of the script that was just executed)
Comment 4 Erik Damrose univentionstaff 2013-12-17 09:34:15 CET
Added an additional logfile flush call

r46784 univention-system-setup 7.0.66-7.556.201312170926
yaml updated: 2013-11-27-univention-system-setup.yaml
Comment 5 Felix Botner univentionstaff 2013-12-17 10:04:26 CET
once again, OK
Comment 6 Moritz Muehlenhoff univentionstaff 2014-01-08 10:25:03 CET
http://errata.univention.de/ucs/3.2/18.html