浏览代码

added denconf option to set usrloc db_mode option

Pavel Kasparek 18 年之前
父节点
当前提交
a12e33d916
共有 4 个文件被更改,包括 31 次插入0 次删除
  1. 2 0
      etc/ser-oob.cfg
  2. 3 0
      pkg/debian/ser-oob.config
  3. 7 0
      pkg/debian/ser-oob.postinst
  4. 19 0
      pkg/debian/ser-oob.templates

+ 2 - 0
etc/ser-oob.cfg

@@ -264,7 +264,9 @@ modparam("acc_db", "db_url", "mysql://ser:[email protected]/ser")
 # however it creates delayed peaks that can impair request-processing
 # latency later (it would have to be re-redesigned more lock-free to
 # avoid it)
+#DEBCONF-DBMODE-START
 modparam("usrloc", "db_mode", 1)
+#DEBCONF-DBMODE-END
 # don't delete expired records from database on a per-contact basis -- that
 # results in bulky DB operations and can lead to synchronization issues
 # in server farm when for a time a server doesn't obtain re-reregistrations

+ 3 - 0
pkg/debian/ser-oob.config

@@ -37,3 +37,6 @@ db_go
 db_input medium ser-oob/NATPING_INTERVAL || true
 db_go
 
+db_input medium ser-oob/DBMODE || true
+db_go
+

+ 7 - 0
pkg/debian/ser-oob.postinst

@@ -177,6 +177,13 @@ modparam("nathelper", "natping_interval", $RET)
 +++
 fi
 
+db_get ser-oob/DBMODE
+if test "$RET" != "!" ; then
+  fn_config_replace $CONFIGFILE DBMODE <<+++
+modparam("usrloc", "db_mode", $RET)
++++
+fi
+
 fi # if changing config
 
 echo ""

+ 19 - 0
pkg/debian/ser-oob.templates

@@ -97,3 +97,22 @@ Description: NAT ping interval
  .
  Enter "!" to not modify this option.
 
+Template: ser-oob/DBMODE
+Type: select
+Choices: 0, 1, 2, !
+Default: 1
+Description: usrloc database mode
+ Set usrloc module db_mode option. Choices are: 0 -- memory cached,
+ 1 -- write thru, 2 -- delayed write.
+ .
+ 1 is generally safer than 2 ... 2 can help to survive peaks in load
+ however it creates delayed peaks that can impair request-processing
+ latency later (it would have to be re-redesigned more lock-free to
+ avoid it).
+ .
+ Enter "!" to not modify this option.
+
+Set address of RTP proxy control socket. Example: "udp:localhost:22222".
+ Enter empty string to not set any RTP proxy address.
+ .
+ Enter "!" to not modify this option.