[Serdev] [BUG] Created: (SER-105) ser -c : clash mod_init/child_init and mod_exit calls

Hendrik Scholz hscholz at raisdorf.net
Sun Apr 16 14:18:20 UTC 2006


Hi!

Michal Matyska (JIRA) wrote:
> If you start ser with -c parameter to check the config file, the mod_exit function is
> beeing called (due to the signal handling, when ser exits), whilst the
> mod_init/child_init were NOT called (and some script rrors, which show up
> at mod_init/child_init fixup/parsing etc, won't be discovered).

After parsing the config file SER should run init_modules() which would
invoke the mod_init() function of each module references in the config.
Once everything is fine we simply call destroy_modules() +
shm_mem_destroy().
Sounds easy but how about shm, timers, database connections, TCP, TLS,
... (see main.c:destroy())?

A sample use case for -c could be to check the config file on a
management box which does not have the same IP addresses as the live
system (home proxies, redundant boxes, you-name-it) and if the config
is fine push it there for a graceful restart.

What I've done is a quick check on which modules can be checked
without
  - transaction module
  - shared memory
  - timers
  - database connection

modules which are just fine:

- auth
- auth_diameter
- avp
- avpops
- dbtext
- dispatcher (this one is interesting)
- diversion
- enum
- exec
- fifo
- flatstore
- mangler
- maxfwd
- nathelper
- options
- permissions (helpful!)
- pike
- print
- ratelimit
- rr
- sanity
- sl
- textops
- xlog

these modules depend on tm:

- acc_db
- acc_syslog
- lcr
- sms
- uac

tm itself depends on shm and timers.

these depend on some sort of database:

- acc_db
- auth_db
- gflags (should be tunable)
- domain
- msilo
- speeddial
- uri_db
- usrloc

usrloc is required by a subset of modules.

The aforementioned use-case of config checks on third
hosts is reality and leads to the conclusion that we
might need a per-module symbol marking the modules
'safe to check anyway', 'ok to check without timers/shm/tm',
'ok to check w/o usrloc/database'.

Esp. permissions and dispatcher are things that one might
want to check before activating the config.
The -c command line option might increase the level of
checks, i.e.

-c   = check modules without any dependencies
-cc  = enable timer/shm and do checks
-ccc = all checks, including database

Just an idea,
  Hendrik

-- 
Hendrik Scholz - <hscholz at raisdorf.net> - http://raisdorf.net/
drag me, drop me - treat me like an object





More information about the Serdev mailing list