Each `systemctl restart univention-directory-manager-rest.service` leaves behind a (temporary) directory including a UNIX domain socket inode: ```console # find /tmp/pymp-* -ls -type s -exec lsof {} + 2357042 4 drwx------ 2 root root 4096 Mai 13 16:48 /tmp/pymp-92yvu7a_ 2357051 0 srwx------ 1 root root 0 Mai 13 16:48 /tmp/pymp-92yvu7a_/listener-is1zm1co 2357014 4 drwx------ 2 root root 4096 Mai 13 16:48 /tmp/pymp-h7fj541c 2357025 0 srwx------ 1 root root 0 Mai 13 16:48 /tmp/pymp-h7fj541c/listener-qyhjmww9 2357093 4 drwx------ 2 root root 4096 Mai 14 05:13 /tmp/pymp-j1rtt2su 2357094 0 srwx------ 1 root root 0 Mai 14 05:13 /tmp/pymp-j1rtt2su/listener-zdcmq7cr 2357053 4 drwx------ 2 root root 4096 Mai 13 16:48 /tmp/pymp-lwilbd1e 2357054 0 srwx------ 1 root root 0 Mai 13 16:48 /tmp/pymp-lwilbd1e/listener-r3rop7x8 2357097 4 drwx------ 2 root root 4096 Mai 14 05:13 /tmp/pymp-uhrttm30 2357098 0 srwx------ 1 root root 0 Mai 14 05:13 /tmp/pymp-uhrttm30/listener-kv0hjg8b 2357080 4 drwx------ 2 root root 4096 Mai 14 05:13 /tmp/pymp-uktly30b 2357092 0 srwx------ 1 root root 0 Mai 14 05:13 /tmp/pymp-uktly30b/listener-277wkk5o COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME /usr/bin/ 8845 root 8u unix 0x0000000041a34a3b 0t0 29515014 /tmp/pymp-uktly30b/listener-277wkk5o type=STREAM /usr/bin/ 8884 root 8u unix 0x0000000001b63641 0t0 29514243 /tmp/pymp-j1rtt2su/listener-zdcmq7cr type=STREAM /usr/bin/ 8901 root 8u unix 0x000000006f0194d6 0t0 29515342 /tmp/pymp-uhrttm30/listener-kv0hjg8b type=STREA ``` 1. A better place would be /run/univention-directory-manager-rest/ which is purged on each reboot 2. should be removed on shutdown.
The directory/socket is created by CPython:Lib/multiprocessing/util.py:get_temp_dir() and supposed to be cleaned up by `_temove_temp_dir()`, which is registered as a `Finalizer(…)` to be called on shutdown via `_exit_function()` registered via `atexit.register(…)`, but both `management/univention-directory-manager-rest/src/univention/admin/rest/__main__.py::Server.run()` and `management/univention-directory-manager-rest/src/univention/admin/rest/server/__init__.py::Gateway.main()` play dirty tricks with its internals and `atexit.unregister(_exit_function)` it. This technical dept was created by https://forge.univention.org/bugzilla/show_bug.cgi?id=50050#c31 without providing any hint on WHY this is needed. An easy solution might be to add [Service] PrivateTmp=yes to management/univention-directory-manager-rest/debian/univention-directory-manager-rest.service and let systemd handle the deletion; see <man:systemd.exec(5)>