[asterisk-commits] mjordan: branch certified-11.2 r381404 - in /certified/branches/11.2: ./ cont...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 14 09:13:41 CST 2013


Author: mjordan
Date: Thu Feb 14 09:13:37 2013
New Revision: 381404

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=381404
Log:
Update init.d scripts to handle stderr; readd splash screen for remote consoles

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

Modified:
    certified/branches/11.2/   (props changed)
    certified/branches/11.2/UPGRADE.txt
    certified/branches/11.2/contrib/init.d/rc.archlinux.asterisk
    certified/branches/11.2/contrib/init.d/rc.debian.asterisk
    certified/branches/11.2/contrib/init.d/rc.gentoo.asterisk
    certified/branches/11.2/contrib/init.d/rc.mandriva.asterisk
    certified/branches/11.2/contrib/init.d/rc.redhat.asterisk
    certified/branches/11.2/contrib/init.d/rc.slackware.asterisk
    certified/branches/11.2/contrib/init.d/rc.suse.asterisk
    certified/branches/11.2/contrib/scripts/safe_asterisk
    certified/branches/11.2/main/asterisk.c

Propchange: certified/branches/11.2/
------------------------------------------------------------------------------
--- branch-11-merged (original)
+++ branch-11-merged Thu Feb 14 09:13:37 2013
@@ -1,1 +1,1 @@
-/branches/11:378038,378287,378321,378409-378411,378582,378687,378690,378984,380465,381306
+/branches/11:378038,378287,378321,378409-378411,378582,378687,378690,378984,379790,380465,381306

Modified: certified/branches/11.2/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.2/UPGRADE.txt?view=diff&rev=381404&r1=381403&r2=381404
==============================================================================
--- certified/branches/11.2/UPGRADE.txt (original)
+++ certified/branches/11.2/UPGRADE.txt Thu Feb 14 09:13:37 2013
@@ -21,6 +21,14 @@
 ===========================================================
 
 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

Modified: certified/branches/11.2/contrib/init.d/rc.archlinux.asterisk
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.2/contrib/init.d/rc.archlinux.asterisk?view=diff&rev=381404&r1=381403&r2=381404
==============================================================================
--- certified/branches/11.2/contrib/init.d/rc.archlinux.asterisk (original)
+++ certified/branches/11.2/contrib/init.d/rc.archlinux.asterisk Thu Feb 14 09:13:37 2013
@@ -33,7 +33,7 @@
     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

Modified: certified/branches/11.2/contrib/init.d/rc.debian.asterisk
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.2/contrib/init.d/rc.debian.asterisk?view=diff&rev=381404&r1=381403&r2=381404
==============================================================================
--- certified/branches/11.2/contrib/init.d/rc.debian.asterisk (original)
+++ certified/branches/11.2/contrib/init.d/rc.debian.asterisk Thu Feb 14 09:13:37 2013
@@ -66,7 +66,7 @@
   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

Modified: certified/branches/11.2/contrib/init.d/rc.gentoo.asterisk
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.2/contrib/init.d/rc.gentoo.asterisk?view=diff&rev=381404&r1=381403&r2=381404
==============================================================================
--- certified/branches/11.2/contrib/init.d/rc.gentoo.asterisk (original)
+++ certified/branches/11.2/contrib/init.d/rc.gentoo.asterisk Thu Feb 14 09:13:37 2013
@@ -20,7 +20,7 @@
 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

Modified: certified/branches/11.2/contrib/init.d/rc.mandriva.asterisk
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.2/contrib/init.d/rc.mandriva.asterisk?view=diff&rev=381404&r1=381403&r2=381404
==============================================================================
--- certified/branches/11.2/contrib/init.d/rc.mandriva.asterisk (original)
+++ certified/branches/11.2/contrib/init.d/rc.mandriva.asterisk Thu Feb 14 09:13:37 2013
@@ -135,7 +135,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=`${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

Modified: certified/branches/11.2/contrib/init.d/rc.redhat.asterisk
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.2/contrib/init.d/rc.redhat.asterisk?view=diff&rev=381404&r1=381403&r2=381404
==============================================================================
--- certified/branches/11.2/contrib/init.d/rc.redhat.asterisk (original)
+++ certified/branches/11.2/contrib/init.d/rc.redhat.asterisk Thu Feb 14 09:13:37 2013
@@ -71,7 +71,7 @@
 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

Modified: certified/branches/11.2/contrib/init.d/rc.slackware.asterisk
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.2/contrib/init.d/rc.slackware.asterisk?view=diff&rev=381404&r1=381403&r2=381404
==============================================================================
--- certified/branches/11.2/contrib/init.d/rc.slackware.asterisk (original)
+++ certified/branches/11.2/contrib/init.d/rc.slackware.asterisk Thu Feb 14 09:13:37 2013
@@ -24,7 +24,7 @@
    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

Modified: certified/branches/11.2/contrib/init.d/rc.suse.asterisk
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.2/contrib/init.d/rc.suse.asterisk?view=diff&rev=381404&r1=381403&r2=381404
==============================================================================
--- certified/branches/11.2/contrib/init.d/rc.suse.asterisk (original)
+++ certified/branches/11.2/contrib/init.d/rc.suse.asterisk Thu Feb 14 09:13:37 2013
@@ -78,7 +78,7 @@
 
 	# 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

Modified: certified/branches/11.2/contrib/scripts/safe_asterisk
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.2/contrib/scripts/safe_asterisk?view=diff&rev=381404&r1=381403&r2=381404
==============================================================================
--- certified/branches/11.2/contrib/scripts/safe_asterisk (original)
+++ certified/branches/11.2/contrib/scripts/safe_asterisk Thu Feb 14 09:13:37 2013
@@ -49,7 +49,7 @@
 
 # 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

Modified: certified/branches/11.2/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/certified/branches/11.2/main/asterisk.c?view=diff&rev=381404&r1=381403&r2=381404
==============================================================================
--- certified/branches/11.2/main/asterisk.c (original)
+++ certified/branches/11.2/main/asterisk.c Thu Feb 14 09:13:37 2013
@@ -3472,7 +3472,7 @@
 
 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;




More information about the asterisk-commits mailing list