fredbcode/Vrrpd — pull request #1 by ivan-zhiltsov (2013-11-12 13:35:14+00:00)
Title: Support setup priorities after SIGTTIN and SIGTTOU

I made small improvemnts to fit my need that don't break nothing and adding:

Two optional command line arguments (x,z) with value of priorities.
If this arguments exists, calling signal SIGTTIN and SIGTTOU istead of increment/decrement priority of running process, it will set values for command line.

I use it in my system to make server "higher as master" or "higher as backup".

For me it is better than just increment/decrement priority because I can send signal many times in case of some event in my network and don't broke logic: with old variant it was possible this case:
original priority was, for example, 50
secondary server had, for example, 45 and it was in backup mode.
for some reason we need to make primary server as backup and send signal SIGTTIN
it change priority to 40 and become backup
if we send SIGTTIN again, its priority changes to 30

after that we want revert config to make first server as master we send SIGTTOU and it increment priority, but if SIGTTIN was send twice or more, server don't become to master.

With this patch I am able to not worry about how many times I called signals to make server backup or master, and sure what priority is set after calling signal.

If command line arguments not set - all works as it was before.

PS. command line arguments named "z", "x" because a failed to create more correct letters for this, all my variants was allready used by other options :(