Below patch introduces a new config script option: shm_size. It takes an integer as argument and specifies the SHM size in MB. As with most options, this will overrule the command line option (-m).
Rationale: I have multiple proxies on 1 host and want to use a common initscript. Not all proxies need the same amount of memory.
patch
Somehow you need to differentiate between the instances, the path to binary or to config should be different, or?
As it is now kamailio, the patch is ok, right now the shm is initialised after parsing the script. I was looking to move that before parsing the script, so the shm can be used during that process. The $shv uses a hack to overcome the missing of shm while parsing.
Another thing that can affect you in the future, the command line parameters are overwritten by the config options, there were couple of debates, some stating it is unnatural this way, they should have higher priority than config file options. Perhaps we should have a decision in this matter as well.
I'm all in favour of the command-line parameters overruling the script. Every other piece of software I have used works that way.
I would also like a script option for every available command-line parameter. (And make them behave identically, unlike the issues with -D, -F) This patch is one step in that direction.