symkat/Daemon-Control — pull request #60 by dev97 (2014-03-18 18:49:59+00:00)
Title: Set supplementary groups for target user

Please test and accept my patch for setting supplementary groups.

I'm sorry for missing documentation (with my English it would be easier to write it from scratch) and I'm sorry for missing formal tests (I afraid tests would be much more complex than code, mock-ups for ``getpwuid``, ``getgrent`` would be needed and I code would look uglier if to wrap ``$)`` access to a hook method to be overridden by testsuite).

I have tested it on my workstation (1. test without root permissions, 2. test with user with many groups, 3. test with user without supplementary groups) and on server as init.d script for real application.

I have also tested the case where 'uid' is specified without 'group' or 'gid' and there is no entry for such 'uid' in /etc/passwd. In this case 'gid' and supplementary groups remain intact. Probably it would be better to die in such case.