Magellan Linux

Annotation of /mcore-src/trunk/mcore-tools/daemon/client/include/sysvinit.client.class

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2079 - (hide annotations) (download)
Fri May 10 11:37:38 2013 UTC (11 years ago) by niro
File size: 1193 byte(s)
-split systemd, sysvinit, fbsplash and plymouth functions in single classes so no runtime checks are required and the correct version get installed right away
1 niro 2079 # $Id$
2    
3     provide basic-init sysvinit
4     require basic-system
5    
6     set_system_service()
7     {
8     local command="$1"
9     local service="$2"
10     local opts="$3"
11    
12     [[ -z ${command} ]] && help_system_service && return 1
13     [[ -z ${service} ]] && help_system_service && return 1
14    
15     if [[ ! -x ${MROOT}/etc/rc.d/init.d/${service} ]]
16     then
17     eecho "Service '${service}' unkown!"
18     return 1
19     fi
20    
21     case "${command}" in
22     start) /etc/rc.d/init.d/"${service}" start ;;
23     stop) /etc/rc.d/init.d/"${service}" stop ;;
24     restart) /etc/rc.d/init.d/"${service}" restart ;;
25     reload) /etc/rc.d/init.d/"${service}" reload ;;
26     add) rc-config add "${service}" ;;
27     del) rc-config del "${service}" ;;
28     *) help_system_service && return ;;
29     esac
30     }
31    
32     get_system_service()
33     {
34     local command="$1"
35     local service="$2"
36    
37     [[ -z ${command} ]] && help_system_service && return 1
38     [[ -z ${service} ]] && help_system_service && return 1
39    
40     if [[ ! -x ${MROOT}/etc/rc.d/init.d/${service} ]]
41     then
42     eecho "Service '${service}' unkown!"
43     return 1
44     fi
45    
46     case "${command}" in
47     status) /etc/rc.d/init.d/"${service}" status ;;
48     enabled) rc-config show "${service}" ;;
49     runlevel) eecho "function on todo" ;;
50     *) help_system_service && return ;;
51     esac
52     }
53