Magellan Linux

Diff of /branches/magellan-next/include/mtools.minc

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

revision 31 by niro, Fri Aug 26 22:19:37 2011 UTC revision 32 by niro, Tue Dec 13 17:33:23 2011 UTC
# Line 104  mstartunit() Line 104  mstartunit()
104  {  {
105   local service="$1"   local service="$1"
106   local service_exec="$2"   local service_exec="$2"
107     local opts
108    
109   # only run if systemd was found   # only run if systemd was found
110   if [[ ! -x /bin/systemctl ]]   if [[ ! -x /bin/systemctl ]]
# Line 112  mstartunit() Line 113  mstartunit()
113   return   return
114   fi   fi
115    
  # we do not support $MROOT atm  
116   if [[ ${MROOT} != / ]] && [[ ! -z ${MROOT} ]]   if [[ ${MROOT} != / ]] && [[ ! -z ${MROOT} ]]
117   then   then
118   echo "\$MROOT is set, doing nothing!"   opts="--root ${MROOT}"
  echo "Please add unit ${service} manually to the runlevels!"  
  echo "Run 'systemctl enable ${service}' in your chroot later on."  
  return  
119   fi   fi
120    
121   if [[ -z ${service_exec} ]]   if [[ -z ${service_exec} ]]
# Line 135  mstartunit() Line 132  mstartunit()
132   # add service to default runlevels   # add service to default runlevels
133   echo -e " ${COLBLUE}[${COLGREEN}+${COLBLUE}]${COLDEFAULT} adding unit ${service} to default runlevels ..."   echo -e " ${COLBLUE}[${COLGREEN}+${COLBLUE}]${COLDEFAULT} adding unit ${service} to default runlevels ..."
134   # reload daemon to honor changed unit files   # reload daemon to honor changed unit files
135   systemctl daemon-reload   systemctl ${opts} daemon-reload
136   systemctl enable ${service}   systemctl ${opts} enable ${service}
137    
138   # do not start services on bootstrap or MROOT!=/   # do not start services on bootstrap or MROOT!=/
139   if [[ ${MAGE_BOOTSTRAP} != true ]] && [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]   if [[ ${MAGE_BOOTSTRAP} != true ]] && [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
# Line 154  mstopunit() Line 151  mstopunit()
151  {  {
152   local service="$1"   local service="$1"
153   local service_exec="$2"   local service_exec="$2"
154     local opts
155    
156   # only run if systemd was found   # only run if systemd was found
157   if [[ ! -x /bin/systemctl ]]   if [[ ! -x /bin/systemctl ]]
# Line 162  mstopunit() Line 160  mstopunit()
160   return   return
161   fi   fi
162    
  # we do not support $MROOT atm  
163   if [[ ${MROOT} != / ]] && [[ ! -z ${MROOT} ]]   if [[ ${MROOT} != / ]] && [[ ! -z ${MROOT} ]]
164   then   then
165   echo "\$MROOT is set, doing nothing!"   opts="--root ${MROOT}"
  echo "Please remove unit ${service} manually from the runlevels!"  
  echo "Run 'systemctl disable ${service}' in your chroot later on."  
  return  
166   fi   fi
167    
168   if [[ -z ${service_exec} ]]   if [[ -z ${service_exec} ]]
# Line 188  mstopunit() Line 182  mstopunit()
182   # del services from runlevel regardless if they exist or not   # del services from runlevel regardless if they exist or not
183   echo -e " ${COLBLUE}[${COLRED}-${COLBLUE}]${COLDEFAULT} removing unit ${service} from default runlevels ..."   echo -e " ${COLBLUE}[${COLRED}-${COLBLUE}]${COLDEFAULT} removing unit ${service} from default runlevels ..."
184   # reload daemon to honor changed unit files   # reload daemon to honor changed unit files
185   systemctl daemon-reload   systemctl ${opts} daemon-reload
186   systemctl disable ${service}   systemctl ${opts} disable ${service}
187    
188   # do not stop services on bootstrap or MROOT!=/   # do not stop services on bootstrap or MROOT!=/
189   if [[ ${MAGE_BOOTSTRAP} != true ]] && [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]   if [[ ${MAGE_BOOTSTRAP} != true ]] && [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
# Line 212  mreloadunit() Line 206  mreloadunit()
206  {  {
207   local service="$1"   local service="$1"
208   local service_exec="$2"   local service_exec="$2"
209     local opts
210    
211   # only run if systemd was found   # only run if systemd was found
212   if [[ ! -x /bin/systemctl ]]   if [[ ! -x /bin/systemctl ]]
# Line 220  mreloadunit() Line 215  mreloadunit()
215   return   return
216   fi   fi
217    
  # we do not support $MROOT atm  
218   if [[ ${MROOT} != / ]] && [[ ! -z ${MROOT} ]]   if [[ ${MROOT} != / ]] && [[ ! -z ${MROOT} ]]
219   then   then
220   echo "\$MROOT is set, doing nothing!"   opts="--root ${MROOT}"
  echo "Please remove unit ${service} manually from the runlevels!"  
  echo "Run 'systemctl disable ${service}' in your chroot later on."  
  return  
221   fi   fi
222    
223   if [[ -z ${service_exec} ]]   if [[ -z ${service_exec} ]]
# Line 241  mreloadunit() Line 232  mreloadunit()
232   fi   fi
233    
234   # reload daemon to honor changed unit files   # reload daemon to honor changed unit files
235   systemctl daemon-reload   systemctl ${opts} daemon-reload
236    
237   # do not stop services on bootstrap or MROOT!=/   # do not stop services on bootstrap or MROOT!=/
238   if [[ ${MAGE_BOOTSTRAP} != true ]] && [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]   if [[ ${MAGE_BOOTSTRAP} != true ]] && [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]

Legend:
Removed from v.31  
changed lines
  Added in v.32