注:以下文章如需转载,请注明所属作者,转载地址,谢谢!
OpenSER v1.2 目录结构
在安装完成后,OpenSER将创建文件安放架构。了解这个架构对于定位系统存储在哪一个主文件夹中是很重要的。你需要这些消息来更新或删除软件。
配置文件(etc/openser)
openser-1:/etc/openser# ls -l
total 12
-rw-r--r-- 1 root root 1804 2007-09-10 14:02 dictionary.radius
-rw-r--r-- 1 root root 4077 2007-09-10 14:05 openser.cfg
-rw-r--r-- 1 root root 1203 2007-09-10 14:02 openserctlrccd
模块(/lib/openser/modules)
openser-1:/lib/openser/modules# ls
acc.so domain.so msilo.so sms.so
alias_db.so enum.so mysql.so speeddial.so
auth_db.so exec.so nathelper.so sst.so
auth_diameter.so flatstore.so options.so statistics.so
auth_radius.so gflags.so path.so textops.so
auth.so group_radius.so pdt.so tm.so
avpops.so group.so permissions.so uac_redirect.so
avp_radius.so imc.so pike.so uac.so
dbtext.so lcr.so registrar.so uri_db.so
dialog.so mangler.so rr.so uri.so
dispatcher.so maxfwd.so seas.so usrloc.so
diversion.so mediaproxy.so siptrace.so xlog.so
domainpolicy.so mi_fifo.so sl.socd /lib/openser/modules
二进制文件(/sbin)
openser-1:/sbin# ls -l op*
-rwxr-xr-x 1 root root 2172235 2007-09-10 14:02 openser
-rwxr-xr-x 1 root root 41862 2007-09-10 14:02 openserctl
-rwxr-xr-x 1 root root 38107 2007-09-10 14:02 openser_mysql.sh
-rwxr-xr-x 1 root root 13562 2007-09-10 14:02 openserunixcd /sbin
日志文件(Log Files)
初始化日志可以在syslog文件中查看到(/var/log/syslog):
Sep 10 14:25:56 openser-1 openser: init_tcp: using epoll_lt as the io watch
method (auto detected)
Sep 10 14:25:56 openser-1 /sbin/openser[7791]: INFO: statistics manager
successfully initialized
Sep 10 14:25:56 openser-1 /sbin/openser[7791]: StateLess module - initializing
Sep 10 14:25:56 openser-1 /sbin/openser[7791]: TM - initializing...
Sep 10 14:25:56 openser-1 /sbin/openser[7791]: Maxfwd module- initializing
Sep 10 14:25:56 openser-1 /sbin/openser[7791]: INFO:ul_init_locks: locks array
size 512
Sep 10 14:25:56 openser-1 /sbin/openser[7791]: TextOPS - initializing
Sep 10 14:25:56 openser-1 /sbin/openser[7791]: INFO: udp_init: SO_RCVBUF is
initially 109568
Sep 10 14:25:56 openser-1 /sbin/openser[7791]: INFO: udp_init: SO_RCVBUF is
finally 262142
Sep 10 14:25:56 openser-1 /sbin/openser[7791]: INFO: udp_init: SO_RCVBUF is
initially 109568
Sep 10 14:25:56 openser-1 /sbin/openser[7791]: INFO: udp_init: SO_RCVBUF is
finally 262142
Sep 10 14:25:56 openser-1 /sbin/openser[7792]: INFO:mi_fifo:mi_child_
init(1): extra fifo listener processes created
启动选项(Startup Options)
OpenSER可以使用初始化脚本或使用openserctl工具进行启动。如果你使用的是初始化脚本启动的openser,那么你也只能使用初始化脚本来终止其运行。同样的道理适用于使用openserctl工具。
使用初始化脚本启动,终止和重启OpenSER。
/etc/init/d/openser start|stop|restart
使用openserctl工具脚本启动,终止和重启OpenSER。
/etc/init/d/openserctl start|stop|restart
OpenSER的执行有几个启动选项。展现于下面的这些选项允许你改变守护进程(DAEMON)的配置。最有用的几个如下:
l “-c”用来查看配置文件
l “-D -E dddddd”用来查看模块加载(不要用于[production??],它只是绑定第一个接口)
还有许多其他的选项允许你调整你的配置。对于每一个选项,在你填入的配置文件中都能找到对应的核心参数。
Usage: openser -l address [-p port] [-l address [-p port]...] [options]
Options:
-f file Configuration file (default //etc/openser/openser.cfg)
-c Check configuration file for errors
-C Similar to '-c' but in addition checks the flags of
exported functions from included route blocks
-l address Listen on the specified address/interface (multiple -l
mean listening on more addresses). The address format
is [proto:]addr[:port], where proto=udp|tcp and
addr= host|ip_address|interface_name. E.g: -l locahost,
-l udp:127.0.0.1:5080, -l eth0:5062 The default
behavior is to listen on all the interfaces.
-n processes Number of child processes to fork per interface
(default: 8)
-r Use dns to check if is necessary to add a "received="
field to a via
-R Same as '-r' but use reverse dns;
(to use both use '-rR')
-v Turn on "via:" host checking when forwarding replies
-d Debugging mode (multiple -d increase the level)
-D Do not fork into daemon mode
-E Log to stderr
-T Disable tcp
-N processes Number of tcp child processes (default: equal to '-n')
-W method poll method
-V Version number
-h This help message
-b nr Maximum receive buffer size which will not be exceeded
by auto-probing procedure even if OS allows
-m nr Size of shared memory allocated in Megabytes
-w dir Change the working directory to "dir" (default "/")
-t dir Chroot to "dir"
-u uid Change uid
-g gid Change gid
-P file Create a pid file
-G file Create a pgid file
-x socket Create a unix domain socket
概要(Summary)
在这一章中你已经学会如何安装OpenSER和为了OpenSER的安装如何准备Linux系统。我们已经下载和编译了OpenSER和MySQL模块。在安装完后,我们又介绍了如何使用OpenSER初始化文件在引导的时候启动OpenSER。