mirror of
https://github.com/asterisk/asterisk.git
synced 2026-01-21 17:12:24 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4db8a85e9 | ||
|
|
42b299ffb2 | ||
|
|
d4a7c0026c | ||
|
|
b2a5b74ebc | ||
|
|
96f99f9732 | ||
|
|
f544f3b196 | ||
|
|
92a6a01c9f | ||
|
|
14a3f2861e |
1
.lastclean
Normal file
1
.lastclean
Normal file
@@ -0,0 +1 @@
|
|||||||
|
33
|
||||||
@@ -51,7 +51,7 @@ if ! [ -d /etc/asterisk ] ; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use the LSB standar functions for services management
|
# Use the LSB standard functions for services management
|
||||||
. /lib/lsb/init-functions
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -65,19 +65,17 @@ case "$1" in
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
log_begin_msg "Starting $DESC: $NAME"
|
log_begin_msg "Starting $DESC: $NAME"
|
||||||
if [ $AST_USER ] ; then
|
if [ $AST_USER ] ; then
|
||||||
ASTARGS="-U $AST_USER"
|
ASTARGS="-U $AST_USER"
|
||||||
fi
|
|
||||||
if [ $AST_GROUP ] ; then
|
|
||||||
ASTARGS="$ASTARGS -G $AST_GROUP"
|
|
||||||
fi
|
|
||||||
# "start-stop-daemon --oknodo" returns 0 even if Asterisk was already running (as LSB expects):
|
|
||||||
if test "x$COLOR" = "xyes" ; then
|
|
||||||
export TERM=linux
|
|
||||||
start-stop-daemon --start --oknodo --background --exec $DAEMON -- $ASTARGS -c
|
|
||||||
else
|
|
||||||
start-stop-daemon --start --oknodo --exec $DAEMON -- $ASTARGS
|
|
||||||
fi
|
fi
|
||||||
|
if [ $AST_GROUP ] ; then
|
||||||
|
ASTARGS="$ASTARGS -G $AST_GROUP"
|
||||||
|
fi
|
||||||
|
if test "x$COLOR" = "xno" ; then
|
||||||
|
ASTARGS="$ASTARGS -n"
|
||||||
|
fi
|
||||||
|
# "start-stop-daemon --oknodo" returns 0 even if Asterisk was already running (as LSB expects):
|
||||||
|
start-stop-daemon --start --oknodo --exec $DAEMON -- $ASTARGS
|
||||||
log_end_msg $?
|
log_end_msg $?
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
|
|||||||
@@ -767,6 +767,7 @@ static void _null_sig_handler(int signal)
|
|||||||
|
|
||||||
static struct sigaction null_sig_handler = {
|
static struct sigaction null_sig_handler = {
|
||||||
.sa_handler = _null_sig_handler,
|
.sa_handler = _null_sig_handler,
|
||||||
|
.sa_flags = SA_RESTART,
|
||||||
};
|
};
|
||||||
|
|
||||||
AST_MUTEX_DEFINE_STATIC(safe_system_lock);
|
AST_MUTEX_DEFINE_STATIC(safe_system_lock);
|
||||||
@@ -1166,6 +1167,7 @@ static void _urg_handler(int num)
|
|||||||
|
|
||||||
static struct sigaction urg_handler = {
|
static struct sigaction urg_handler = {
|
||||||
.sa_handler = _urg_handler,
|
.sa_handler = _urg_handler,
|
||||||
|
.sa_flags = SA_RESTART,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void _hup_handler(int num)
|
static void _hup_handler(int num)
|
||||||
@@ -1185,6 +1187,7 @@ static void _hup_handler(int num)
|
|||||||
|
|
||||||
static struct sigaction hup_handler = {
|
static struct sigaction hup_handler = {
|
||||||
.sa_handler = _hup_handler,
|
.sa_handler = _hup_handler,
|
||||||
|
.sa_flags = SA_RESTART,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void _child_handler(int sig)
|
static void _child_handler(int sig)
|
||||||
@@ -1203,6 +1206,7 @@ static void _child_handler(int sig)
|
|||||||
|
|
||||||
static struct sigaction child_handler = {
|
static struct sigaction child_handler = {
|
||||||
.sa_handler = _child_handler,
|
.sa_handler = _child_handler,
|
||||||
|
.sa_flags = SA_RESTART,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! \brief Set an X-term or screen title */
|
/*! \brief Set an X-term or screen title */
|
||||||
|
|||||||
@@ -581,6 +581,7 @@ static void _handle_SIGXFSZ(int sig)
|
|||||||
|
|
||||||
static struct sigaction handle_SIGXFSZ = {
|
static struct sigaction handle_SIGXFSZ = {
|
||||||
.sa_handler = _handle_SIGXFSZ,
|
.sa_handler = _handle_SIGXFSZ,
|
||||||
|
.sa_flags = SA_RESTART,
|
||||||
};
|
};
|
||||||
|
|
||||||
int init_logger(void)
|
int init_logger(void)
|
||||||
|
|||||||
24
main/term.c
24
main/term.c
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Asterisk -- An open source telephony toolkit.
|
* Asterisk -- An open source telephony toolkit.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 - 2005, Digium, Inc.
|
* Copyright (C) 1999 - 2010, Digium, Inc.
|
||||||
*
|
*
|
||||||
* Mark Spencer <markster@digium.com>
|
* Mark Spencer <markster@digium.com>
|
||||||
*
|
*
|
||||||
@@ -18,9 +18,9 @@
|
|||||||
|
|
||||||
/*! \file
|
/*! \file
|
||||||
*
|
*
|
||||||
* \brief Terminal Routines
|
* \brief Terminal Routines
|
||||||
*
|
*
|
||||||
* \author Mark Spencer <markster@digium.com>
|
* \author Mark Spencer <markster@digium.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "asterisk.h"
|
#include "asterisk.h"
|
||||||
@@ -79,12 +79,21 @@ int ast_term_init(void)
|
|||||||
char buffer[512] = "";
|
char buffer[512] = "";
|
||||||
int termfd = -1, parseokay = 0, i;
|
int termfd = -1, parseokay = 0, i;
|
||||||
|
|
||||||
if (!term)
|
if (ast_opt_no_color) {
|
||||||
return 0;
|
|
||||||
if (!ast_opt_console || ast_opt_no_color || !ast_opt_no_fork)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
for (i=0 ;; i++) {
|
if (!ast_opt_console) {
|
||||||
|
/* If any remote console is not compatible, we'll strip the color codes at that point */
|
||||||
|
vt100compat = 1;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!term) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0;; i++) {
|
||||||
if (termpath[i] == NULL) {
|
if (termpath[i] == NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -138,6 +147,7 @@ int ast_term_init(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
if (vt100compat) {
|
if (vt100compat) {
|
||||||
/* Make commands show up in nice colors */
|
/* Make commands show up in nice colors */
|
||||||
snprintf(prepdata, sizeof(prepdata), "%c[%d;%d;%dm", ESC, ATTR_BRIGHT, COLOR_BROWN, COLOR_BLACK + 10);
|
snprintf(prepdata, sizeof(prepdata), "%c[%d;%d;%dm", ESC, ATTR_BRIGHT, COLOR_BROWN, COLOR_BLACK + 10);
|
||||||
|
|||||||
Reference in New Issue
Block a user