浏览代码

Move most defaults to default file

tags/1.2
Timo Röhling 10 年前
父节点
当前提交
f0ec8943b4
共有 5 个文件被更改,包括 22 次插入41 次删除
  1. 7
    4
      init/postsrsd.default.in
  2. 5
    4
      init/postsrsd.systemd.in
  3. 4
    11
      init/postsrsd.sysv-lsb.in
  4. 4
    11
      init/postsrsd.sysv-redhat.in
  5. 2
    11
      init/postsrsd.upstart.in

+ 7
- 4
init/postsrsd.default.in 查看文件

@@ -17,7 +17,7 @@
17 17
 # When postsrsd is installed for the first time, a random secret is generated
18 18
 # and stored in /etc/postsrsd.secret. For most installations, that's just fine.
19 19
 #
20
-#SRS_SECRET=@SYSCONF_DIR@/@PROJECT_NAME@.secret
20
+SRS_SECRET=@SYSCONF_DIR@/@PROJECT_NAME@.secret
21 21
 
22 22
 # Local ports for TCP list.
23 23
 # These ports are used to bind the TCP list for postfix. If you change
@@ -25,11 +25,14 @@
25 25
 # are bound to the loopback interface, and should never be exposed on
26 26
 # the internet.
27 27
 #
28
-#SRS_FORWARD_PORT=10001
29
-#SRS_REVERSE_PORT=10002
28
+SRS_FORWARD_PORT=10001
29
+SRS_REVERSE_PORT=10002
30 30
 
31 31
 # Drop root privileges and run as another user after initialization.
32 32
 # This is highly recommended as postsrsd handles untrusted input.
33 33
 #
34
-#RUN_AS=nobody
34
+RUN_AS=nobody
35
+
36
+# Jail daemon in chroot environment
37
+CHROOT=@CHROOT_DIR@
35 38
 

+ 5
- 4
init/postsrsd.systemd.in 查看文件

@@ -4,11 +4,12 @@ After=network.target
4 4
 
5 5
 [Service]
6 6
 Type=simple
7
-Environment=SRS_DOMAIN=localhost.localdomain SRS_FORWARD_PORT=10001 SRS_REVERSE_PORT=10002 SRS_SECRET=@SYSCONF_DIR@/@PROJECT_NAME@.secret
8
-Environment=SRS_EXCLUDE_DOMAINS= RUN_AS=nobody CHROOT=@CHROOT_DIR@
9
-EnvironmentFile=-@CONFIG_DIR@/@PROJECT_NAME@
10
-ExecStart=@CMAKE_INSTALL_PREFIX@/sbin/@POSTSRSD@ -4 -f${SRS_FORWARD_PORT} -r${SRS_REVERSE_PORT} -d${SRS_DOMAIN} -s${SRS_SECRET} -u${RUN_AS} -c${CHROOT} -X${SRS_EXCLUDE_DOMAINS}
7
+Environment SRS_DOMAIN=localhost.localdomain
8
+Environment SRS_EXCLUDE_DOMAINS=
9
+EnvironmentFile=@CONFIG_DIR@/@PROJECT_NAME@
10
+ExecStart=@CMAKE_INSTALL_PREFIX@/sbin/@POSTSRSD@ -f${SRS_FORWARD_PORT} -r${SRS_REVERSE_PORT} -d${SRS_DOMAIN} -s${SRS_SECRET} -u${RUN_AS} -c${CHROOT} -X${SRS_EXCLUDE_DOMAINS}
11 11
 Restart=always
12 12
 
13 13
 [Install]
14 14
 WantedBy=multi-user.target
15
+

+ 4
- 11
init/postsrsd.sysv-lsb.in 查看文件

@@ -29,17 +29,10 @@ test -x $DAEMON || exit 0
29 29
 
30 30
 # Default configuration
31 31
 SRS_DOMAIN=`postconf -h mydomain || true`
32
-SRS_FORWARD_PORT=10001
33
-SRS_REVERSE_PORT=10002
34
-SRS_SECRET=@SYSCONF_DIR@/@PROJECT_NAME@.secret
35
-RUN_AS=nobody
36
-CHROOT=@CHROOT_DIR@
32
+SRS_EXCLUDE_DOMAINS=
37 33
 
38
-# Read config file if it is present.
39
-if [ -r @CONFIG_DIR@/$NAME ]
40
-then
41
-    . @CONFIG_DIR@/$NAME
42
-fi
34
+# Read config file
35
+. @CONFIG_DIR@/$NAME
43 36
 
44 37
 test -r "$SRS_SECRET" -a -n "$SRS_DOMAIN" || exit 0
45 38
 
@@ -51,7 +44,7 @@ case "$1" in
51 44
 		--pidfile $PIDFILE \
52 45
 		--name $NAME \
53 46
 		--startas $DAEMON \
54
-		-- -4 -f"$SRS_FORWARD_PORT" -r"$SRS_REVERSE_PORT" -d"$SRS_DOMAIN" -s"$SRS_SECRET" -u"$RUN_AS" -p"$PIDFILE" -c"$CHROOT" -X"$SRS_EXCLUDE_DOMAINS" -D
47
+		-- -f"$SRS_FORWARD_PORT" -r"$SRS_REVERSE_PORT" -d"$SRS_DOMAIN" -s"$SRS_SECRET" -u"$RUN_AS" -p"$PIDFILE" -c"$CHROOT" -X"$SRS_EXCLUDE_DOMAINS" -D
55 48
 	then
56 49
 	    log_end_msg 0
57 50
 	else

+ 4
- 11
init/postsrsd.sysv-redhat.in 查看文件

@@ -25,24 +25,17 @@ test -x $DAEMON || exit 0
25 25
 
26 26
 # Default configuration
27 27
 SRS_DOMAIN=`postconf -h mydomain || true`
28
-SRS_FORWARD_PORT=10001
29
-SRS_REVERSE_PORT=10002
30
-SRS_SECRET=@SYSCONF_DIR@/@PROJECT_NAME@.secret
31
-RUN_AS=nobody
32
-CHROOT=@CHROOT_DIR@
28
+SRS_EXCLUDE_DOMAINS=
33 29
 
34
-# Read config file if it is present.
35
-if [ -r @CONFIG_DIR@/$NAME ]
36
-then
37
-    . @CONFIG_DIR@/$NAME
38
-fi
30
+# Read config file
31
+. @CONFIG_DIR@/$NAME
39 32
 
40 33
 test -r "$SRS_SECRET" -a -n "$SRS_DOMAIN" || exit 0
41 34
 
42 35
 do_start()
43 36
 {
44 37
 	echo -n "Starting $DESC: "
45
-	daemon $DAEMON -4 -f"$SRS_FORWARD_PORT" -r"$SRS_REVERSE_PORT" -d"$SRS_DOMAIN" -s"$SRS_SECRET" \
38
+	daemon $DAEMON -f"$SRS_FORWARD_PORT" -r"$SRS_REVERSE_PORT" -d"$SRS_DOMAIN" -s"$SRS_SECRET" \
46 39
 	               -u"$RUN_AS" -p"$PIDFILE" -c"$CHROOT" -X"$SRS_EXCLUDE_DOMAINS" -D
47 40
 	RETVAL=$?
48 41
 	echo

+ 2
- 11
init/postsrsd.upstart.in 查看文件

@@ -5,19 +5,10 @@ start on (filesystem and net-device-up)
5 5
 stop on runlevel [!2345]
6 6
 respawn
7 7
 
8
-env DEFAULTFILE=@CONFIG_DIR@/@PROJECT_NAME@
9
-
10 8
 script
11 9
 	SRS_DOMAIN=`postconf -h mydomain || true`
12
-	SRS_FORWARD_PORT=10001
13
-	SRS_REVERSE_PORT=10002
14
-	SRS_SECRET=@SYSCONF_DIR@/@PROJECT_NAME@.secret
15 10
 	SRS_EXCLUDE_DOMAINS=
16
-	RUN_AS=nobody
17
-	CHROOT=@CHROOT_DIR@
18
-	if [ -r "$DEFAULTFILE" ]; then
19
-		. "$DEFAULTFILE"
20
-	fi
21
-	exec @CMAKE_INSTALL_PREFIX@/sbin/@POSTSRSD@ -4 -f"$SRS_FORWARD_PORT" -r"$SRS_REVERSE_PORT" -d"$SRS_DOMAIN" -s"$SRS_SECRET" -u"$RUN_AS" -c"$CHROOT" -X"$SRS_EXCLUDE_DOMAINS"
11
+	. "@CONFIG_DIR@/@PROJECT_NAME@"
12
+	exec @CMAKE_INSTALL_PREFIX@/sbin/@POSTSRSD@ -f"$SRS_FORWARD_PORT" -r"$SRS_REVERSE_PORT" -d"$SRS_DOMAIN" -s"$SRS_SECRET" -u"$RUN_AS" -c"$CHROOT" -X"$SRS_EXCLUDE_DOMAINS"
22 13
 end script
23 14
 

正在加载...
取消
保存