Pārlūkot izejas kodu

Update startup scripts

tags/1.3
Timo Röhling 9 gadus atpakaļ
vecāks
revīzija
050c6a2407

+ 3
- 1
CMakeLists.txt Parādīt failu

@@ -7,8 +7,10 @@ option(USE_APPARMOR "Enable AppArmor profile" OFF)
7 7
 
8 8
 set(CHROOT_DIR "${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}" CACHE PATH "Chroot jail for daemon")
9 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 11
 set(CONFIG_DIR "${SYSCONF_DIR}/default" CACHE PATH "Location of startup configuration file")
11 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 15
 find_program(HELP2MAN help2man DOC "path to help2man executable")
14 16
 find_program(DD dd DOC "path to dd executable")
@@ -45,7 +47,7 @@ if(HAVE_TIME_H)
45 47
 endif()
46 48
 
47 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 51
         message(STATUS "Detected init flavor: systemd")
50 52
         set(INIT_FLAVOR "systemd" CACHE STRING "Init daemon of this system")
51 53
     elseif(IS_DIRECTORY "${SYSCONF_DIR}/init" AND EXISTS "/lib/init/upstart-job")

+ 1
- 1
init/postsrsd.default.in Parādīt failu

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

+ 1
- 1
init/postsrsd.systemd.in Parādīt failu

@@ -6,7 +6,7 @@ Type=simple
6 6
 Environment=SRS_DOMAIN=localhost.localdomain
7 7
 Environment=SRS_EXCLUDE_DOMAINS=
8 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 10
 Restart=always
11 11
 
12 12
 [Install]

+ 1
- 1
init/postsrsd.sysv-lsb.in Parādīt failu

@@ -44,7 +44,7 @@ case "$1" in
44 44
 		--pidfile $PIDFILE \
45 45
 		--name $NAME \
46 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 48
 	then
49 49
 	    log_end_msg 0
50 50
 	else

+ 1
- 1
init/postsrsd.sysv-redhat.in Parādīt failu

@@ -36,7 +36,7 @@ do_start()
36 36
 {
37 37
 	echo -n "Starting $DESC: "
38 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 40
 	RETVAL=$?
41 41
 	echo
42 42
     	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME

+ 1
- 1
init/postsrsd.upstart.in Parādīt failu

@@ -9,6 +9,6 @@ script
9 9
 	SRS_DOMAIN=`postconf -h mydomain || true`
10 10
 	SRS_EXCLUDE_DOMAINS=
11 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 13
 end script
14 14
 

+ 2
- 1
postinstall.cmake.in Parādīt failu

@@ -1,5 +1,6 @@
1 1
 set(GENERATE_SRS_SECRET "@GENERATE_SRS_SECRET@")
2 2
 set(SYSCONF_DIR "@SYSCONF_DIR@")
3
+set(SYSD_UNIT_DIR "@SYSD_UNIT_DIR@")
3 4
 set(CHROOT_DIR "@CHROOT_DIR@")
4 5
 set(CONFIG_DIR "@CONFIG_DIR@")
5 6
 set(INIT_FLAVOR "@INIT_FLAVOR@")
@@ -35,7 +36,7 @@ elseif(INIT_FLAVOR STREQUAL "sysv-redhat")
35 36
 elseif(INIT_FLAVOR STREQUAL "upstart")
36 37
 	file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.upstart" DESTINATION "${SYSCONF_DIR}/init" RENAME "@PROJECT_NAME@.conf")
37 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 40
 endif()
40 41
 
41 42
 if(GENERATE_SRS_SECRET AND DD AND BASE64_ENCODE AND EXISTS "/dev/urandom" AND NOT EXISTS "$ENV{DESTDIR}${SYSCONF_DIR}/${SECRET_FILE}")

Notiek ielāde…
Atcelt
Saglabāt