Univention Bugzilla – Bug 29714
Definierte Reihenfolge der Setup-Skripte
Last modified: 2013-11-19 06:44:20 CET
Derzeite ist die Reihenfolge der Setup-Skripte bzgl. ihrer Ordner nicht fix: > for root, dirs, files in os.walk('/usr/lib/univention-system-setup/scripts/'): print root, dirs, files > ... > /usr/lib/univention-system-setup/scripts/ ['basis', 'software', 'timezone', 'modules', 'net', 'join', 'defaultlocale', 'system_settings', 'role', 'ssl', 'language', 'keyboard'] ['ldif_rewrite.py', 'setup-join.sh', 'ldif_rewrite.pyc', 'setup_utils.sh', 'ldap_available.sh'] > /usr/lib/univention-system-setup/scripts/basis [] ['16windows_domain', '12domainname', '18root_password', '14ldap_basis', '10hostname'] > /usr/lib/univention-system-setup/scripts/software [] ['10software'] > /usr/lib/univention-system-setup/scripts/timezone [] ['10timezone'] > /usr/lib/univention-system-setup/scripts/modules [] [] > /usr/lib/univention-system-setup/scripts/net [] ['13ipv6gateway', '11ipv6interfaces', '16forwarder', '14nameserver', '18proxy', '12gateway', '10interfaces'] > /usr/lib/univention-system-setup/scripts/join [] [] > /usr/lib/univention-system-setup/scripts/defaultlocale [] [] > /usr/lib/univention-system-setup/scripts/system_settings [] [] > /usr/lib/univention-system-setup/scripts/role [] ['10role'] > /usr/lib/univention-system-setup/scripts/ssl [] ['10ssl'] > /usr/lib/univention-system-setup/scripts/language [] ['11default_locale', '10language'] > /usr/lib/univention-system-setup/scripts/keyboard [] ['10keyboard'] Sinnvoll wäre es wahrscheinlich, wenn die Order ebenfalls mit einem numerischen Präfix versehen und sortiert werden (wie die Skript-Dateien selber).
Wo werden die Skripte denn in einer beliebigen Reihenfolge ausgeführt?
(In reply to comment #1) > Wo werden die Skripte denn in einer beliebigen Reihenfolge ausgeführt? Bei mir wurde z.B. erst 10software ausgeführt und danach 10interfaces → Dadurch war noch kein Netzwerk vorhanden und es konnte keine Installation gestartet werden.
(In reply to comment #2) > (In reply to comment #1) > > Wo werden die Skripte denn in einer beliebigen Reihenfolge ausgeführt? > Bei mir wurde z.B. erst 10software ausgeführt und danach 10interfaces → Dadurch > war noch kein Netzwerk vorhanden und es konnte keine Installation gestartet > werden. Im Appliance Modus oder später?
(In reply to comment #3) > (In reply to comment #2) > > (In reply to comment #1) > > > Wo werden die Skripte denn in einer beliebigen Reihenfolge ausgeführt? > > Bei mir wurde z.B. erst 10software ausgeführt und danach 10interfaces → Dadurch > > war noch kein Netzwerk vorhanden und es konnte keine Installation gestartet > > werden. > > Im Appliance Modus oder später? Ich glaube es war auf einem gejointem system im system-setup-boot.
We will not ship a UCS 3.1-2 release; the next UCS release will be UCS 3.2. As such, this bug is moved to the new target milestone.
Please also fix setup-join.sh. The script does the following steps (among others) in this order: 1) SSL 1.1) run rdate 1.2) create new SSL certificate 2) timezone 2.1) set timezone 2.2) /etc/init.d/ntp-server stop; /etc/init.d/ntpdate restart; /etc/init.d/ntp-server start 3) power up the network Problems: → rdate is run before the network is up → rdate works only if the systems starts via DHCP with valid route to the internet → ntp-server does not exist anymore → new script name seems to be "ntp" → ntpdate seems not to provide a init script anymore (ntpdate binary was installed)
I observed this traceback: > 29.07.13 10:11:45.416 MODULE ( WARN ) : Exception during saving the settings: global name 'stat' is not defined > File "/usr/lib/pymodules/python2.6/notifier/threads.py", line 82, in _run > tmp = self._function() > File "/usr/lib/pymodules/python2.6/notifier/__init__.py", line 104, in __call__ > return self._function( *tmp, **self._kwargs ) > File "/usr/lib/pymodules/python2.6/univention/management/console/modules/setup/__init__.py", line 172, in _thread > util.run_scripts( self._progressParser, restart ) > File "/usr/lib/pymodules/python2.6/univention/management/console/modules/setup/util.py", line 348, in run_scripts > for scriptpath in sorted_files_in_subdirs( PATH_SETUP_SCRIPTS ): > File "/usr/lib/pymodules/python2.6/univention/management/console/modules/setup/util.py", line 335, in sorted_files_in_subdirs > if stat.S_ISDIR(os.stat(path).st_mode): > > NameError: global name 'stat' is not defined ps: I needed to print the traceback explicitely in order to see the traceback. Maybe adding a line to the debug such as > msg = '%s\n%s: %s\n' % (''.join(traceback.format_tb(thread.exc_info[2])), thread.exc_info[0].__name__, str(thread.exc_info[1])) > MODULE.warn( 'Exception during saving the settings: %s\n%s' % (result, msg) ) would be helpful in the _finished() functions for future problems?
* The directories are now ordered by number prefixes: 05_role 10_basis 15_keyboard 20_language 25_defaultlocale 30_net 35_timezone 40_ssl 45_modules 50_software 55_system_settings 60_join * So, net is called before ntpdate (in 35_timezone) and before ssl. * The python run_scripts function employed by the UMC command "setup/save" now iterates over these directories in the proper order. * setup-join.sh also calls (a selection of) them "manually" in this order.
Created attachment 5348 [details] Print tracebacks in UMC setup module. The except is wrong, except is evil: > + except: > + msg = '%s\n%s: %s\n' % (''.join(traceback.format_tb(thread.exc_info[2])), thread.exc_info[0].__name__, str(thread.exc_info[1])) > + MODULE.warn( 'Exception during saving the settings: %s\n%s' % (result, msg) ) The check should be done in the finish callback function (see attached patch).
Created attachment 5351 [details] /var/log/univention/setup.log Changelog → OK Appliance setup → OK Could you add a MODULE.info() line prompting the currently executed script before calling subprocess.Popen() (that wasn't there before, either, but would be helpful for debugging) ? The progress bar seems to be incorrect... in utils.py: the dict ProgressParser:FRACTIONS needs to be adapted to the new names. Even then the progress is for the removal/installation of software components incorrect → I opened Bug 32148 for this. Also, I get somewhat confused that some output related to the certificate generation is located before any script header (e.g., "=== 05_role/10role (2013-08-02 13:14:28) ===", see the attached log file). Maybe there is a problem related to stdout and stderr? Maybe a flush is missing?
> MODULE.info() line prompting the currently executed script before calling Added. > The progress bar seems to be incorrect... in utils.py: > the dict ProgressParser:FRACTIONS needs to be adapted to the new names. Adjusted. > Also, I get somewhat confused that some output related to the certificate > generation is located before any script header (e.g., "=== 05_role/10role > (2013-08-02 13:14:28) ===", see the attached log file). Maybe there is a > problem related to stdout and stderr? Maybe a flush is missing? Popen call adjusted.
Looks good! → VERIFIED
UCS 3.2 has been released: http://docs.univention.de/release-notes-3.2-en.html http://docs.univention.de/release-notes-3.2-de.html If this error occurs again, please use "Clone This Bug".