From: Automerge script Date: Mon, 21 Jan 2013 20:27:46 +0000 (+0000) Subject: Merged revisions 379777 via svnmerge from X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3416071b7e57b73731bc9eba1eb36c25c028768;p=thirdparty%2Fasterisk.git Merged revisions 379777 via svnmerge from file:///srv/subversion/repos/asterisk/branches/10 ................ r379777 | mjordan | 2013-01-21 14:24:24 -0600 (Mon, 21 Jan 2013) | 34 lines 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. *** NOTE *** If you're wondering why this got merged into 10, it's because we're going to release a regression release with this in it. Might as well get it into the branch so the tag reflects some version of reality. (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 ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10-digiumphones@379788 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/UPGRADE.txt b/UPGRADE.txt index 8b494a2afd..2a29420b49 100644 --- a/UPGRADE.txt +++ b/UPGRADE.txt @@ -19,6 +19,16 @@ === =========================================================== +from 10.12.0 to 10.12.1: + +* 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. + From 10.11 to 10.12: * Asterisk has always had code to ignore dash '-' characters that are not diff --git a/contrib/init.d/rc.archlinux.asterisk b/contrib/init.d/rc.archlinux.asterisk index ab67114484..9c840851c8 100755 --- a/contrib/init.d/rc.archlinux.asterisk +++ b/contrib/init.d/rc.archlinux.asterisk @@ -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 diff --git a/contrib/init.d/rc.debian.asterisk b/contrib/init.d/rc.debian.asterisk index f99aade20a..211737fa9d 100755 --- a/contrib/init.d/rc.debian.asterisk +++ b/contrib/init.d/rc.debian.asterisk @@ -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 diff --git a/contrib/init.d/rc.gentoo.asterisk b/contrib/init.d/rc.gentoo.asterisk index ef54a0efab..04d1c7aab2 100755 --- a/contrib/init.d/rc.gentoo.asterisk +++ b/contrib/init.d/rc.gentoo.asterisk @@ -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 diff --git a/contrib/init.d/rc.mandriva.asterisk b/contrib/init.d/rc.mandriva.asterisk index 319ce3e4ed..e095ccf753 100755 --- a/contrib/init.d/rc.mandriva.asterisk +++ b/contrib/init.d/rc.mandriva.asterisk @@ -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 diff --git a/contrib/init.d/rc.redhat.asterisk b/contrib/init.d/rc.redhat.asterisk index 01ab86247d..45ea9bccf6 100755 --- a/contrib/init.d/rc.redhat.asterisk +++ b/contrib/init.d/rc.redhat.asterisk @@ -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 diff --git a/contrib/init.d/rc.slackware.asterisk b/contrib/init.d/rc.slackware.asterisk index bbe04b7fae..79c2b927f6 100755 --- a/contrib/init.d/rc.slackware.asterisk +++ b/contrib/init.d/rc.slackware.asterisk @@ -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 diff --git a/contrib/init.d/rc.suse.asterisk b/contrib/init.d/rc.suse.asterisk index ee70eea7a8..16530968eb 100755 --- a/contrib/init.d/rc.suse.asterisk +++ b/contrib/init.d/rc.suse.asterisk @@ -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 diff --git a/contrib/scripts/safe_asterisk b/contrib/scripts/safe_asterisk index 2adb0c5c48..fbfddc1799 100644 --- a/contrib/scripts/safe_asterisk +++ b/contrib/scripts/safe_asterisk @@ -47,7 +47,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 diff --git a/main/asterisk.c b/main/asterisk.c index f089340727..292c6aed69 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -3368,7 +3368,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;