]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Update init.d scripts to handle stderr; readd splash screen for remote consoles
authorMatthew Jordan <mjordan@digium.com>
Thu, 14 Feb 2013 15:13:37 +0000 (15:13 +0000)
committerMatthew Jordan <mjordan@digium.com>
Thu, 14 Feb 2013 15:13:37 +0000 (15:13 +0000)
When r376428 was commited to re-order start up sequences to be more tolerant of
forking with thread primitives, a few items were changed that caused changes
in behavior on some distros. This includes:
 * Not displaying the splash screen on a remote console.
 * Displaying an error message on stderr when a remote console cannot connect
   to a running instance of Asterisk.

In the first case, the splash screen was re-added (thanks to Michael L. Young).
In the second case, the various init.d scripts were modified to pipe stderr
to /dev/null, as the error message is useful - if you execute a remote
console or a remote console command execution and it fail, it should tell
you. Note that the error message was always present, it just failed to be
printed prior to r376428.

Much thanks to the folks who quickly reported this problem, provided solutions,
and promptly tested the various init.d scripts on a variety of distros.

(closes issue ASTERISK-20945)
Reported by: Warren Selby
Tested by: Michael L. Young, Jamuel Starkey, kaldemar, Danny Nicholas, mjordan
patches:
  asterisk-20945-remote-intro-msg.diff uploaded by elguero (license 5026)
  ASTERISK-20945-1.8-mjordan.diff uploaded by mjordan (license 6283)
........

Merged revisions 379760 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 379777 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 379790 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381404 65c4cc65-6c06-0410-ace0-fbb531ad65f3

UPGRADE.txt
contrib/init.d/rc.archlinux.asterisk
contrib/init.d/rc.debian.asterisk
contrib/init.d/rc.gentoo.asterisk
contrib/init.d/rc.mandriva.asterisk
contrib/init.d/rc.redhat.asterisk
contrib/init.d/rc.slackware.asterisk
contrib/init.d/rc.suse.asterisk
contrib/scripts/safe_asterisk
main/asterisk.c

index ae1ba2feeb71eae3f3a47d8ee87688a95f6b7cda..974822a9ad7b331915428e4805e0263090998476 100644 (file)
 
 From 11.1 to 11.2:
 
+* Asterisk would previously not output certain error messages when a remote
+  console attempted to connect to Asterisk and no instance of Asterisk was
+  running. This error message is displayed on stderr; as a result, some
+  initialization scripts that used remote consoles to test for the presence
+  of a running Asterisk instance started to display erroneous error messages.
+  The init.d scripts and the safe_asterisk have been updated in the contrib
+  folder to account for this.
+
 * Asterisk has always had code to ignore dash '-' characters that are not
   part of a character set in the dialplan extensions.  The code now
   consistently ignores these characters when matching dialplan extensions.
index ab6711448434546b204c9c9f1f0d732fe8606c49..9c840851c8169f08d8a99b2ee024353dd665b3c1 100755 (executable)
@@ -33,7 +33,7 @@ case "$1" in
     if [ -x $DAEMON ]; then
       # Check if Asterisk is already running.  If it is, then bug out, because
       # starting safe_asterisk when Asterisk is running is very bad.
-      VERSION=`${DAEMON} -rx 'core show version'`
+      VERSION=`${DAEMON} -rx 'core show version' 2>/dev/null`
       if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
          echo "Asterisk is already running.  $0 will exit now."
          exit 1
index f99aade20a62bd5052ec6db247361db1e04517a1..211737fa9d9f4c8554f5bfe37c3d5f67d8f0003b 100755 (executable)
@@ -66,7 +66,7 @@ case "$1" in
   start)
        # Check if Asterisk is already running.  If it is, then bug out, because
        # starting up Asterisk when Asterisk is already running is very bad.
-       VERSION=`${DAEMON} -rx 'core show version' || ${TRUE}`
+       VERSION=`${DAEMON} -rx 'core show version' 2>/dev/null || ${TRUE}`
        if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
                echo "Asterisk is already running.  $0 will exit now."
                exit 0
index ef54a0efab579838212a8dac82660185a68bd725..04d1c7aab2c87b203afad6d26b2f191396f2e046 100755 (executable)
@@ -20,7 +20,7 @@ depend() {
 start() {
        # Check if Asterisk is already running.  If it is, then bug out, because
        # starting safe_asterisk when Asterisk is running is very bad.
-       VERSION=`${ASTSBINDIR}/asterisk -rx 'core show version'`
+       VERSION=`${ASTSBINDIR}/asterisk -rx 'core show version' 2>/dev/null`
        if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
                echo "Asterisk is already running.  $0 will exit now."
                exit 1
index 319ce3e4edc05edd36b24870874cdb6c457b9524..e095ccf753882b188bc60b3c493e61e89e200025 100755 (executable)
@@ -135,7 +135,7 @@ case "$1" in
        start)
                # Check if Asterisk is already running.  If it is, then bug out, because
                # starting Asterisk when Asterisk is already running is very bad.
-               VERSION=`${ASTSBINDIR}/asterisk -rx 'core show version'`
+               VERSION=`${ASTSBINDIR}/asterisk -rx 'core show version' 2>/dev/null`
                if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
                        echo "Asterisk is already running.  $0 will exit now."
                        exit 1
index 01ab86247dc74802c3ed45426dd59fe5bd32386f..45ea9bccf6d1e904475249e28ebda4232bd03623 100755 (executable)
@@ -71,7 +71,7 @@ RETVAL=0
 start() {
        # Check if Asterisk is already running.  If it is, then bug out, because
        # starting safe_asterisk when Asterisk is running is very bad.
-       VERSION=`${AST_SBIN}/asterisk -rx 'core show version'`
+       VERSION=`${AST_SBIN}/asterisk -rx 'core show version' 2>/dev/null`
        if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
                echo "Asterisk is already running."
                exit 0
index bbe04b7faee032acf61956a15bf93643db49ec62..79c2b927f6e471b83fd7b0a6adce5a57bb05b295 100755 (executable)
@@ -24,7 +24,7 @@ asterisk_start() {
    if [ -x /usr/sbin/asterisk ]; then
       # Check if Asterisk is already running.  If it is, then bug out, because
       # starting safe_asterisk when Asterisk is running is very bad.
-      VERSION=`/usr/sbin/asterisk -rx 'core show version'`
+      VERSION=`/usr/sbin/asterisk -rx 'core show version' 2>/dev/null`
          if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
          echo "Asterisk is already running.  $0 will exit now."
          exit 1
index ee70eea7a8e433329c0c7aabcf08911f1891a0c5..16530968eb6d40e5448d7772525c712aa04c0a73 100755 (executable)
@@ -78,7 +78,7 @@ start() {
 
        # Check if Asterisk is already running.  If it is, then bug out, because
        # starting Asterisk when Asterisk is already running is very bad.
-       VERSION=`/usr/sbin/asterisk -rx 'core show version'`
+       VERSION=`/usr/sbin/asterisk -rx 'core show version' 2>/dev/null`
        if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
                echo "Asterisk is already running.  $0 will exit now."
                exit 1
index c1f058aa02f5aa9df1d9d12b3ffeed934aae7621..2e661b47668f7168ecbc5969f403767a01ab1954 100644 (file)
@@ -49,7 +49,7 @@ message() {
 
 # Check if Asterisk is already running.  If it is, then bug out, because
 # starting safe_asterisk when Asterisk is running is very bad.
-VERSION=`${ASTSBINDIR}/asterisk -nrx 'core show version'`
+VERSION=`${ASTSBINDIR}/asterisk -nrx 'core show version' 2>/dev/null`
 if test "`echo $VERSION | cut -c 1-8`" = "Asterisk" ; then
        message "Asterisk is already running.  $0 will exit now."
        exit 1
index 187f582013d4424acbad13e0b322a4464834b045..44ce274d1d3befe9e202604ff5301fe9a924ffba 100644 (file)
@@ -3472,7 +3472,7 @@ static void env_init(void)
 
 static void print_intro_message(const char *runuser, const char *rungroup)
 {
-       if (ast_opt_console || option_verbose) {
+       if (ast_opt_console || option_verbose || (ast_opt_remote && !ast_opt_exec)) {
                if (ast_register_verbose(console_verboser)) {
                        fprintf(stderr, "Unable to register console verboser?\n");
                        return;