Browse Source

Move most defaults to default file

tags/1.2
Timo Röhling 10 years ago
parent
commit
f0ec8943b4

+ 7
- 4
init/postsrsd.default.in View File

17
 # When postsrsd is installed for the first time, a random secret is generated
17
 # When postsrsd is installed for the first time, a random secret is generated
18
 # and stored in /etc/postsrsd.secret. For most installations, that's just fine.
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
 # Local ports for TCP list.
22
 # Local ports for TCP list.
23
 # These ports are used to bind the TCP list for postfix. If you change
23
 # These ports are used to bind the TCP list for postfix. If you change
25
 # are bound to the loopback interface, and should never be exposed on
25
 # are bound to the loopback interface, and should never be exposed on
26
 # the internet.
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
 # Drop root privileges and run as another user after initialization.
31
 # Drop root privileges and run as another user after initialization.
32
 # This is highly recommended as postsrsd handles untrusted input.
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 View File

4
 
4
 
5
 [Service]
5
 [Service]
6
 Type=simple
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
 Restart=always
11
 Restart=always
12
 
12
 
13
 [Install]
13
 [Install]
14
 WantedBy=multi-user.target
14
 WantedBy=multi-user.target
15
+

+ 4
- 11
init/postsrsd.sysv-lsb.in View File

29
 
29
 
30
 # Default configuration
30
 # Default configuration
31
 SRS_DOMAIN=`postconf -h mydomain || true`
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
 test -r "$SRS_SECRET" -a -n "$SRS_DOMAIN" || exit 0
37
 test -r "$SRS_SECRET" -a -n "$SRS_DOMAIN" || exit 0
45
 
38
 
51
 		--pidfile $PIDFILE \
44
 		--pidfile $PIDFILE \
52
 		--name $NAME \
45
 		--name $NAME \
53
 		--startas $DAEMON \
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
 	then
48
 	then
56
 	    log_end_msg 0
49
 	    log_end_msg 0
57
 	else
50
 	else

+ 4
- 11
init/postsrsd.sysv-redhat.in View File

25
 
25
 
26
 # Default configuration
26
 # Default configuration
27
 SRS_DOMAIN=`postconf -h mydomain || true`
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
 test -r "$SRS_SECRET" -a -n "$SRS_DOMAIN" || exit 0
33
 test -r "$SRS_SECRET" -a -n "$SRS_DOMAIN" || exit 0
41
 
34
 
42
 do_start()
35
 do_start()
43
 {
36
 {
44
 	echo -n "Starting $DESC: "
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
 	               -u"$RUN_AS" -p"$PIDFILE" -c"$CHROOT" -X"$SRS_EXCLUDE_DOMAINS" -D
39
 	               -u"$RUN_AS" -p"$PIDFILE" -c"$CHROOT" -X"$SRS_EXCLUDE_DOMAINS" -D
47
 	RETVAL=$?
40
 	RETVAL=$?
48
 	echo
41
 	echo

+ 2
- 11
init/postsrsd.upstart.in View File

5
 stop on runlevel [!2345]
5
 stop on runlevel [!2345]
6
 respawn
6
 respawn
7
 
7
 
8
-env DEFAULTFILE=@CONFIG_DIR@/@PROJECT_NAME@
9
-
10
 script
8
 script
11
 	SRS_DOMAIN=`postconf -h mydomain || true`
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
 	SRS_EXCLUDE_DOMAINS=
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
 end script
13
 end script
23
 
14
 

Loading…
Cancel
Save