Magellan Linux

Diff of /trunk/initscripts/sysvinit/rc/functions

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/magellan-initscripts/etc/rc.d/init.d/functions revision 1093 by niro, Wed Jul 14 13:07:30 2010 UTC trunk/initscripts/sysvinit/rc/functions revision 1893 by niro, Wed Aug 22 17:57:39 2012 UTC
# Line 17  KILLDELAY=3 Line 17  KILLDELAY=3
17    
18  COLUMNS=$(stty size)  COLUMNS=$(stty size)
19  COLUMNS=${COLUMNS##* }  COLUMNS=${COLUMNS##* }
20    if [[ -z ${COLUMNS} ]] || [[ ${COLUMNS} = 0 ]]
21    then
22     COLUMNS=80
23    fi
24  COL=$[ $COLUMNS - 10 ]  COL=$[ $COLUMNS - 10 ]
25  WCOL=$[ $COLUMNS - 30 ]  WCOL=$[ $COLUMNS - 30 ]
26  WWCOL=$[ $COLUMNS - 40 ]  WWCOL=$[ $COLUMNS - 40 ]
# Line 47  svcmount="no" Line 51  svcmount="no"
51  svcfstype="tmpfs"  svcfstype="tmpfs"
52  svcsize=1024  svcsize=1024
53    
54    rc_echo() { echo "$@"; }
55    rc_print() { rc_echo -e "${COLOREDSTAR}$@"; }
56    
57  # dummy function; needed if splashutils are not installed  # dummy function; needed if splashutils are not installed
58  splash() { return 0; }  splash() { return 0; }
# Line 139  evaluate_retval() Line 145  evaluate_retval()
145   print_status success   print_status success
146   else   else
147   print_status failure   print_status failure
148    
149     if [[ ${SPLASH_VERBOSE_ON_ERRORS} = 1 ]]
150     then
151     splash "rc_verbose" "${runlevel}"
152     fi
153   fi   fi
154    
155   return ${error_value}   return ${error_value}
# Line 196  print_status() Line 207  print_status()
207    
208  getpids()  getpids()
209  {  {
210   base=${1##*/}   local base=${1##*/}
211   pidlist=$(pidof -o $$ -o $PPID -x $base)   local opts
212     if [[ $(readlink /bin/pidof) = *busybox ]]
213     then
214     opts=""
215     else
216     opts="-x"
217     fi
218     pidlist=$(pidof -o $$ -o $PPID ${opts} $base)
219  }  }
220    
221  loadproc()  loadproc()
# Line 259  killproc() Line 277  killproc()
277   done   done
278    
279   base=${1##*/}   base=${1##*/}
280   if [ $failure = 0 ]; then rm -f /var/run/$base.pid; fi   if [ $failure = 0 ]; then rm -f /run/$base.pid; fi
281    
282   (exit $failure)   (exit $failure)
283   evaluate_retval   evaluate_retval
# Line 318  statusproc() Line 336  statusproc()
336   then   then
337   echo "$base is running with Process ID(s) $pidlist"   echo "$base is running with Process ID(s) $pidlist"
338   else   else
339   if [ -s /var/run/$base.pid ]   if [ -s /run/$base.pid ]
340   then   then
341   echo "$1 is not running but /var/run/$base.pid exists"   echo "$1 is not running but /run/$base.pid exists"
342   return 1   return 1
343   else   else
344   echo "$1 is not running"   echo "$1 is not running"
# Line 453  is_older_than() Line 471  is_older_than()
471    
472   return 1   return 1
473  }  }
474    
475    # read /etc/os-release file
476    # read_os_release $item
477    read_os_release()
478    {
479     local NAME
480     local ID
481     local Version
482     local Version_ID
483     local PRETTY_NAME
484     local ANSI_COLOR
485     local CPE_NAME
486    
487     if [[ -f /etc/os-release ]]
488     then
489     source /etc/os-release
490    
491     case $1 in
492     name) echo "${NAME}" ;;
493     id) echo "${ID}" ;;
494     version) echo "${Version}" ;;
495     version_id) echo "${Version_ID}" ;;
496     pretty_name) echo "${PRETTY_NAME}" ;;
497     ansi_color) echo "${ANSI_COLOR}" ;;
498     cpe_name) echo "${CPE_NAME}" ;;
499     esac
500     fi
501    }
502    
503    start_devicemanager() { touch /dev/.none; return 0; }
504    stop_devicemanager() { return 0; }

Legend:
Removed from v.1093  
changed lines
  Added in v.1893