Server IP : 127.0.0.2 / Your IP : 18.224.212.19 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/lsb/init-functions.d/ |
Upload File : |
# Default init script logging functions suitable for Ubuntu. # See /lib/lsb/init-functions for usage help. LOG_DAEMON_MSG="" log_use_plymouth () { if [ "${loop:-n}" = y ]; then return 1 fi plymouth --ping >/dev/null 2>&1 } log_success_msg () { echo " * $@" || true } log_failure_msg () { if log_use_fancy_output; then RED=`$TPUT setaf 1` NORMAL=`$TPUT op` echo " $RED*$NORMAL $@" || true else echo " * $@" || true fi } log_warning_msg () { if log_use_fancy_output; then YELLOW=`$TPUT setaf 3` NORMAL=`$TPUT op` echo " $YELLOW*$NORMAL $@" || true else echo " * $@" || true fi } log_begin_msg () { log_daemon_msg "$1" } log_daemon_msg () { if [ -z "$1" ]; then return 1 fi if log_use_fancy_output && $TPUT xenl >/dev/null 2>&1; then COLS=`$TPUT cols` if [ "$COLS" ] && [ "$COLS" -gt 6 ]; then COL=`$EXPR $COLS - 7` else COLS=80 COL=73 fi if log_use_plymouth; then # If plymouth is running, don't output anything at this time # to avoid buffering problems (LP: #752393) if [ -z "$LOG_DAEMON_MSG" ]; then LOG_DAEMON_MSG=$* return fi fi # We leave the cursor `hanging' about-to-wrap (see terminfo(5) # xenl, which is approximately right). That way if the script # prints anything then we will be on the next line and not # overwrite part of the message. # Previous versions of this code attempted to colour-code the # asterisk but this can't be done reliably because in practice # init scripts sometimes print messages even when they succeed # and we won't be able to reliably know where the colourful # asterisk ought to go. printf " * $* " || true # Enough trailing spaces for ` [fail]' to fit in; if the message # is too long it wraps here rather than later, which is what we # want. $TPUT hpa `$EXPR $COLS - 1` || true printf ' ' || true else echo " * $@" || true COL= fi } log_progress_msg () { : } log_end_msg () { if [ -z "$1" ]; then return 1 fi if [ "$COL" ] && [ -x "$TPUT" ]; then # If plymouth is running, print previously stored output # to avoid buffering problems (LP: #752393) if log_use_plymouth; then if [ -n "$LOG_DAEMON_MSG" ]; then log_daemon_msg $LOG_DAEMON_MSG LOG_DAEMON_MSG="" fi fi printf "\r" || true $TPUT hpa $COL if [ "$1" -eq 0 ]; then echo "[ OK ]" || true else printf '[' || true $TPUT setaf 1 || true # red printf fail || true $TPUT op || true # normal echo ']' || true fi else if [ "$1" -eq 0 ]; then echo " ...done." || true else echo " ...fail!" || true fi fi return $1 } log_action_msg () { echo " * $@" || true } log_action_begin_msg () { log_daemon_msg "$@..." || true } log_action_cont_msg () { log_daemon_msg "$@..." || true } log_action_end_msg () { # In the future this may do something with $2 as well. log_end_msg "$1" || true }