Browse Source

Update startup scripts

tags/1.3
Timo Röhling 9 years ago
parent
commit
050c6a2407

+ 3
- 1
CMakeLists.txt View File

7
 
7
 
8
 set(CHROOT_DIR "${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}" CACHE PATH "Chroot jail for daemon")
8
 set(CHROOT_DIR "${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}" CACHE PATH "Chroot jail for daemon")
9
 set(SYSCONF_DIR "/etc" CACHE PATH "Global system configuration folder")
9
 set(SYSCONF_DIR "/etc" CACHE PATH "Global system configuration folder")
10
+set(SYSD_UNIT_DIR "${SYSCONF_DIR}/systemd/system" CACHE PATH "Systemd unit file folder")
10
 set(CONFIG_DIR "${SYSCONF_DIR}/default" CACHE PATH "Location of startup configuration file")
11
 set(CONFIG_DIR "${SYSCONF_DIR}/default" CACHE PATH "Location of startup configuration file")
11
 set(DOC_DIR "share/doc/${PROJECT_NAME}" CACHE PATH "Path for documentation files")
12
 set(DOC_DIR "share/doc/${PROJECT_NAME}" CACHE PATH "Path for documentation files")
13
+mark_as_advanced(CHROOT_DIR SYSCONF_DIR SYSD_UNIT_DIR CONFIG_DIR DOC_DIR)
12
 
14
 
13
 find_program(HELP2MAN help2man DOC "path to help2man executable")
15
 find_program(HELP2MAN help2man DOC "path to help2man executable")
14
 find_program(DD dd DOC "path to dd executable")
16
 find_program(DD dd DOC "path to dd executable")
45
 endif()
47
 endif()
46
 
48
 
47
 if(NOT DEFINED INIT_FLAVOR)
49
 if(NOT DEFINED INIT_FLAVOR)
48
-	if(IS_DIRECTORY "${SYSCONF_DIR}/systemd" AND EXISTS "/usr/lib/systemd/systemd")
50
+	if(IS_DIRECTORY "${SYSD_UNIT_DIR}" AND EXISTS "/usr/lib/systemd/systemd")
49
         message(STATUS "Detected init flavor: systemd")
51
         message(STATUS "Detected init flavor: systemd")
50
         set(INIT_FLAVOR "systemd" CACHE STRING "Init daemon of this system")
52
         set(INIT_FLAVOR "systemd" CACHE STRING "Init daemon of this system")
51
     elseif(IS_DIRECTORY "${SYSCONF_DIR}/init" AND EXISTS "/lib/init/upstart-job")
53
     elseif(IS_DIRECTORY "${SYSCONF_DIR}/init" AND EXISTS "/lib/init/upstart-job")

+ 1
- 1
init/postsrsd.default.in View File

15
 
15
 
16
 # First separator character after SRS0 or SRS1.
16
 # First separator character after SRS0 or SRS1.
17
 # Can be one of: -+=
17
 # Can be one of: -+=
18
-#SRS_SEPARATOR==
18
+SRS_SEPARATOR==
19
 
19
 
20
 # Secret key to sign rewritten addresses.
20
 # Secret key to sign rewritten addresses.
21
 # When postsrsd is installed for the first time, a random secret is generated
21
 # When postsrsd is installed for the first time, a random secret is generated

+ 1
- 1
init/postsrsd.systemd.in View File

6
 Environment=SRS_DOMAIN=localhost.localdomain
6
 Environment=SRS_DOMAIN=localhost.localdomain
7
 Environment=SRS_EXCLUDE_DOMAINS=
7
 Environment=SRS_EXCLUDE_DOMAINS=
8
 EnvironmentFile=@CONFIG_DIR@/@PROJECT_NAME@
8
 EnvironmentFile=@CONFIG_DIR@/@PROJECT_NAME@
9
-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}
9
+ExecStart=@CMAKE_INSTALL_PREFIX@/sbin/@POSTSRSD@ -f"${SRS_FORWARD_PORT}" -r"${SRS_REVERSE_PORT}" -d"${SRS_DOMAIN}" -s"${SRS_SECRET}" -a"${SRS_SEPARATOR}" -u"${RUN_AS}" -c"${CHROOT}" -X"${SRS_EXCLUDE_DOMAINS}"
10
 Restart=always
10
 Restart=always
11
 
11
 
12
 [Install]
12
 [Install]

+ 1
- 1
init/postsrsd.sysv-lsb.in View File

44
 		--pidfile $PIDFILE \
44
 		--pidfile $PIDFILE \
45
 		--name $NAME \
45
 		--name $NAME \
46
 		--startas $DAEMON \
46
 		--startas $DAEMON \
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
47
+		-- -f"$SRS_FORWARD_PORT" -r"$SRS_REVERSE_PORT" -d"$SRS_DOMAIN" -s"$SRS_SECRET" -a "$SRS_SEPARATOR" -u"$RUN_AS" -p"$PIDFILE" -c"$CHROOT" -X"$SRS_EXCLUDE_DOMAINS" -D
48
 	then
48
 	then
49
 	    log_end_msg 0
49
 	    log_end_msg 0
50
 	else
50
 	else

+ 1
- 1
init/postsrsd.sysv-redhat.in View File

36
 {
36
 {
37
 	echo -n "Starting $DESC: "
37
 	echo -n "Starting $DESC: "
38
 	daemon $DAEMON -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" \
39
-	               -u"$RUN_AS" -p"$PIDFILE" -c"$CHROOT" -X"$SRS_EXCLUDE_DOMAINS" -D
39
+	               -u"$RUN_AS" -p"$PIDFILE" -a "$SRS_SEPARATOR" -c"$CHROOT" -X"$SRS_EXCLUDE_DOMAINS" -D
40
 	RETVAL=$?
40
 	RETVAL=$?
41
 	echo
41
 	echo
42
     	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
42
     	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME

+ 1
- 1
init/postsrsd.upstart.in View File

9
 	SRS_DOMAIN=`postconf -h mydomain || true`
9
 	SRS_DOMAIN=`postconf -h mydomain || true`
10
 	SRS_EXCLUDE_DOMAINS=
10
 	SRS_EXCLUDE_DOMAINS=
11
 	. "@CONFIG_DIR@/@PROJECT_NAME@"
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"
12
+	exec @CMAKE_INSTALL_PREFIX@/sbin/@POSTSRSD@ -f"$SRS_FORWARD_PORT" -r"$SRS_REVERSE_PORT" -d"$SRS_DOMAIN" -s"$SRS_SECRET" -a "$SRS_SEPARATOR" -u"$RUN_AS" -c"$CHROOT" -X"$SRS_EXCLUDE_DOMAINS"
13
 end script
13
 end script
14
 
14
 

+ 2
- 1
postinstall.cmake.in View File

1
 set(GENERATE_SRS_SECRET "@GENERATE_SRS_SECRET@")
1
 set(GENERATE_SRS_SECRET "@GENERATE_SRS_SECRET@")
2
 set(SYSCONF_DIR "@SYSCONF_DIR@")
2
 set(SYSCONF_DIR "@SYSCONF_DIR@")
3
+set(SYSD_UNIT_DIR "@SYSD_UNIT_DIR@")
3
 set(CHROOT_DIR "@CHROOT_DIR@")
4
 set(CHROOT_DIR "@CHROOT_DIR@")
4
 set(CONFIG_DIR "@CONFIG_DIR@")
5
 set(CONFIG_DIR "@CONFIG_DIR@")
5
 set(INIT_FLAVOR "@INIT_FLAVOR@")
6
 set(INIT_FLAVOR "@INIT_FLAVOR@")
35
 elseif(INIT_FLAVOR STREQUAL "upstart")
36
 elseif(INIT_FLAVOR STREQUAL "upstart")
36
 	file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.upstart" DESTINATION "${SYSCONF_DIR}/init" RENAME "@PROJECT_NAME@.conf")
37
 	file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.upstart" DESTINATION "${SYSCONF_DIR}/init" RENAME "@PROJECT_NAME@.conf")
37
 elseif(INIT_FLAVOR STREQUAL "systemd")
38
 elseif(INIT_FLAVOR STREQUAL "systemd")
38
-	file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.systemd" DESTINATION "${SYSCONF_DIR}/systemd/system" RENAME "@PROJECT_NAME@.service")
39
+	file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.systemd" DESTINATION "${SYSD_UNIT_DIR}" RENAME "@PROJECT_NAME@.service")
39
 endif()
40
 endif()
40
 
41
 
41
 if(GENERATE_SRS_SECRET AND DD AND BASE64_ENCODE AND EXISTS "/dev/urandom" AND NOT EXISTS "$ENV{DESTDIR}${SYSCONF_DIR}/${SECRET_FILE}")
42
 if(GENERATE_SRS_SECRET AND DD AND BASE64_ENCODE AND EXISTS "/dev/urandom" AND NOT EXISTS "$ENV{DESTDIR}${SYSCONF_DIR}/${SECRET_FILE}")

Loading…
Cancel
Save