Sanlock daemon used to collect and set the supplementary groups after
daemonizing. Collecting the groups may be slow on overloaded machines
creating a window where sanlock supplementary groups are not empty. This
was confusing vdsm-tool while it tried to configure sanlock.
This patch collect the supplementary groups before daemonizing, so
programs managing sanlock would wait until it collected the necessary
information for the daemon, minimizing the window where the daemon is
running is not configured properly yet.
We ignore now the current process groups since we are interested only in
the effective user supplementary groups. This change also drop the
complex code needed to eliminate duplicates between current process
groups and user supplementary groups.
This change also fix the log when getgrouplist() fails; according to the
manual, this means the number of groups is bigger than the requested
size.
git send-email had trouble sending the patch to the list; please check
the patch on github:
https://github.com/nirs/sanlock/commit/4c314e5b6e176e95ef60033184089c29d9...
Regards,
Nir