Univention Bugzilla – Bug 52887
import log symlink creation does not check existence of parent directory
Last modified: 2021-03-24 14:13:57 CET
An initial UCS@school import on a fresh installation terminates (after a successful run) with: ----------------------------------------------------------------------------- 00:19:46 stderr: 231 Creating symlink from '/var/log/univention/ucs-school-import.log' to '/var/log/univention/ucs-school-import/LAST-LOG-DEBUG'. 00:19:46 Traceback (most recent call last): 00:19:46 File "/usr/share/ucs-school-import/scripts/import_user", line 46, in <module> 00:19:46 sys.exit(main()) 00:19:46 File "/usr/share/ucs-school-import/scripts/import_user", line 42, in main 00:19:46 return ui.main() 00:19:46 File "/usr/lib/pymodules/python2.7/ucsschool/importer/frontend/cmdline.py", line 238, in main 00:19:46 self.prepare_import() 00:19:46 File "/usr/lib/pymodules/python2.7/ucsschool/importer/frontend/cmdline.py", line 197, in prepare_import 00:19:46 self.setup_logging(self.args.verbose, self.args.logfile) 00:19:46 File "/usr/lib/pymodules/python2.7/ucsschool/importer/frontend/cmdline.py", line 103, in setup_logging 00:19:46 self.create_symlink(filename, LAST_LOG_DEBUG_SYMLINK) 00:19:46 File "/usr/lib/pymodules/python2.7/ucsschool/importer/frontend/cmdline.py", line 234, in create_symlink 00:19:46 os.symlink(source, link_name) 00:19:46 OSError: [Errno 2] No such file or directory ----------------------------------------------------------------------------- The reason is, that the function creating the symlink does not check if the directory to contain the link exists.
The directory is now created if it does not exist, before creating the symlinks. [4.4] 5b5c0d37b Bug #52887: create directory for symlinks for log files if missing [4.4] 81074a707 Bug #52887: advisory ucs-school-import (17.0.52)
Changelog&Advisory: OK Jenkins: OK Code Review: OK Manual Test: OK
UCS@school 4.4 v9 has been released. https://docs.software-univention.de/changelog-ucsschool-4.4v9-de.html If this error occurs again, please clone this bug.