From a73dfe9c8570724fd0602b497ba8c3d18c1964db Mon Sep 17 00:00:00 2001 From: damencho Date: Mon, 21 Nov 2016 12:55:45 -0600 Subject: [PATCH] Stores component secret. Stores component secret, in order to use it from other components when installed on the same machine. Fixes jvb reconfigure missing JAVA_SYS_PROPS. Fixes correctly getting jvb service status. --- resources/install/debian/control | 3 +-- resources/install/debian/postinst | 11 +++++++---- resources/install/debian/templates | 5 +++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/resources/install/debian/control b/resources/install/debian/control index e5980e67e9..eaae4fd0f2 100644 --- a/resources/install/debian/control +++ b/resources/install/debian/control @@ -9,8 +9,7 @@ Homepage: https://jitsi.org/videobridge Package: jitsi-videobridge Architecture: any -Pre-Depends: default-jre-headless -Depends: ${misc:Depends} +Depends: ${misc:Depends}, default-jre-headless Recommends: authbind Description: WebRTC compatible Selective Forwarding Unit (SFU) Jitsi Videobridge is a WebRTC compatible Selective Forwarding Unit diff --git a/resources/install/debian/postinst b/resources/install/debian/postinst index 4ef3b2157b..2bee0dfbef 100644 --- a/resources/install/debian/postinst +++ b/resources/install/debian/postinst @@ -70,11 +70,14 @@ case "$1" in echo '# extra options to pass to the JVB daemon' >> $CONFIG echo "JVB_OPTS=\"\"" >> $CONFIG echo >> $CONFIG - echo '# extra jvm params' >> $CONFIG - echo "#JVB_EXTRA_JVM_PARAMS=\"-javaagent:/usr/share/newrelic/newrelic.jar -Dnewrelic.config.file=/etc/jitsi/videobridge/newrelic.yml\"" >> $CONFIG fi + # Store it, so we can use it if xmpp server is on same machine + # we are currently doing this on every upgrade in order to be able to succesfully upgrade + # from old packages, otherwise we can do it only when secret is first time generated + db_set jitsi-videobridge/jvbsecret $JVB_SECRET + # and we're done with debconf db_stop @@ -92,7 +95,7 @@ case "$1" in # let's check whether there is a setting in the $CONFIG # for home folder and logging props file, if missing add it - if [ ! -n "$JAVA_SYS_PROPS" ]; then + if ! grep -q "JAVA_SYS_PROPS" "$CONFIG"; then echo >> $CONFIG echo '# adds java system props that are passed to jvb (default are for home and logging config file)' >> $CONFIG echo "JAVA_SYS_PROPS=\"\$JVB_EXTRA_JVM_PARAMS -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/jitsi\ @@ -142,7 +145,7 @@ case "$1" in ls /var/log/jitsi/jvb* 1>/dev/null 2>&1 && chmod -f -R 640 /var/log/jitsi/jvb* # ensure videobridge is not running - it will be started at the end - if invoke-rc.d jitsi-videobridge >/dev/null 2>&1 ; then + if invoke-rc.d jitsi-videobridge status >/dev/null 2>&1 ; then invoke-rc.d jitsi-videobridge stop || true fi diff --git a/resources/install/debian/templates b/resources/install/debian/templates index c7156f5646..ddfaa6bdfe 100644 --- a/resources/install/debian/templates +++ b/resources/install/debian/templates @@ -3,3 +3,8 @@ Type: string Default: localhost _Description: Hostname: The jisti-videobridge package needs the DNS hostname of your instance. + +Template: jitsi-videobridge/jvbsecret +Type: password +_Description: The secret used to connect to xmpp server as component + Component secret: