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 1104 by niro, Wed Jul 14 14:31:47 2010 UTC trunk/initscripts/sysvinit/rc/functions revision 1774 by niro, Sat Mar 3 16:00:17 2012 UTC
# Line 47  svcmount="no" Line 47  svcmount="no"
47  svcfstype="tmpfs"  svcfstype="tmpfs"
48  svcsize=1024  svcsize=1024
49    
50    rc_echo() { echo $@; }
51    rc_print() { rc_echo -e "${COLOREDSTAR}$@"; }
52    
53  # dummy function; needed if splashutils are not installed  # dummy function; needed if splashutils are not installed
54  splash() { return 0; }  splash() { return 0; }
# Line 139  evaluate_retval() Line 141  evaluate_retval()
141   print_status success   print_status success
142   else   else
143   print_status failure   print_status failure
144    
145     if [[ ${SPLASH_VERBOSE_ON_ERRORS} = 1 ]]
146     then
147     splash "rc_verbose" "${runlevel}"
148     fi
149   fi   fi
150    
151   return ${error_value}   return ${error_value}
# Line 196  print_status() Line 203  print_status()
203    
204  getpids()  getpids()
205  {  {
206   base=${1##*/}   local base=${1##*/}
207   pidlist=$(pidof -o $$ -o $PPID -x $base)   local opts
208     if [[ $(readlink /bin/pidof) = *busybox ]]
209     then
210     opts=""
211     else
212     opts="-x"
213     fi
214     pidlist=$(pidof -o $$ -o $PPID ${opts} $base)
215  }  }
216    
217  loadproc()  loadproc()
# Line 259  killproc() Line 273  killproc()
273   done   done
274    
275   base=${1##*/}   base=${1##*/}
276   if [ $failure = 0 ]; then rm -f /var/run/$base.pid; fi   if [ $failure = 0 ]; then rm -f /run/$base.pid; fi
277    
278   (exit $failure)   (exit $failure)
279   evaluate_retval   evaluate_retval
# Line 318  statusproc() Line 332  statusproc()
332   then   then
333   echo "$base is running with Process ID(s) $pidlist"   echo "$base is running with Process ID(s) $pidlist"
334   else   else
335   if [ -s /var/run/$base.pid ]   if [ -s /run/$base.pid ]
336   then   then
337   echo "$1 is not running but /var/run/$base.pid exists"   echo "$1 is not running but /run/$base.pid exists"
338   return 1   return 1
339   else   else
340   echo "$1 is not running"   echo "$1 is not running"
# Line 454  is_older_than() Line 468  is_older_than()
468   return 1   return 1
469  }  }
470    
471    # read /etc/os-release file
472    # read_os_release $item
473    read_os_release()
474    {
475     local NAME
476     local ID
477     local Version
478     local Version_ID
479     local PRETTY_NAME
480     local ANSI_COLOR
481     local CPE_NAME
482    
483     if [[ -f /etc/os-release ]]
484     then
485     source /etc/os-release
486    
487     case $1 in
488     name) echo "${NAME}" ;;
489     id) echo "${ID}" ;;
490     version) echo "${Version}" ;;
491     version_id) echo "${Version_ID}" ;;
492     pretty_name) echo "${PRETTY_NAME}" ;;
493     ansi_color) echo "${ANSI_COLOR}" ;;
494     cpe_name) echo "${CPE_NAME}" ;;
495     esac
496     fi
497    }
498    
499  start_devicemanager() { touch /dev/.none; return 0; }  start_devicemanager() { touch /dev/.none; return 0; }
500  stop_devicemanager() { return 0; }  stop_devicemanager() { return 0; }

Legend:
Removed from v.1104  
changed lines
  Added in v.1774