Univention Bugzilla – Bug 42475
sysvol sync: lock is not released if process is killed
Last modified: 2016-10-20 12:40:40 CEST
Stop cron /etc/init.d/cron stop Added "sleep 1000" to /usr/share/univention-samba4/scripts/sysvol-sync.sh after "flock -n 9 || exit 0" line. Start script bash -x /usr/share/univention-samba4/scripts/sysvol-sync.sh Kill both sysvol-sync.sh processes kill 563 565 Restart script -> bash -x /usr/share/univention-samba4/scripts/sysvol-sync.sh + . /usr/share/univention-lib/ucr.sh ++ /usr/sbin/univention-config-registry shell hostname samba4/sysvol/sync/host + eval hostname=master ++ hostname=master + DEBUG=false + SYSVOL_PATH=/var/lib/samba/sysvol + SYSVOL_SYNCDIR=/var/cache/univention-samba4/sysvol-sync + SYSVOL_SYNC_TRIGGERDIR=/var/cache/univention-samba4/sysvol-sync/.trigger + PROCESS_LOCKFILE=/var/lock/sysvol-sync-process + SYSVOL_LOCKFILE=/var/lock/sysvol-sync-dir + LC_ALL=C + flock -n 9 + exit 0 Now flock can't get the lock and immediately exists Problem seems to be the missing flock -u -u, --unlock Drop a lock. This is usually not required, since a lock is automatically dropped when the file is closed. However, it may be required in special cases, for example if the enclosed command group may have forked a background process which should not be holding the lock. Replacing "flock -n 9 || exit 0" with "flock -un 9 || exit 0" works for me
fixed in univention-samba4 (72750) in errata4.1-3, merged to 4.2-0 univention-samba4.yaml
Please check the YAML file: http://jenkins.knut.univention.de:8080/job/UCS-4.1/job/UCS-4.1-3/job/ErrataValidation/lastCompletedBuild/testReport/
(In reply to Stefan Gohmann from comment #2) > Please check the YAML file: > http://jenkins.knut.univention.de:8080/job/UCS-4.1/job/UCS-4.1-3/job/ > ErrataValidation/lastCompletedBuild/testReport/ fixed (univention-samba in yaml instead of univention-samba4) Also had to fix debian/rules (split override_dh_fixperms into override_dh_fixperms and override_dh_fixperms-indep), as we no longer build the all packages on amd64.
Ok, works and the advisory is ok.
<http://errata.software-univention.de/ucs/4.1/309.html>