[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
talk:howtos:general_admin:openrc [2018/11/06 19:35 (UTC)] – add section for migration to openrc 0.39+ aadityatalk:howtos:general_admin:openrc [2018/11/07 07:36 (UTC)] (current) – change heading format aaditya
Line 23: Line 23:
  --- //[[wiki:user:aaditya|Aaditya Bagga]] 2015/05/18 10:50//  --- //[[wiki:user:aaditya|Aaditya Bagga]] 2015/05/18 10:50//
  
-=== Migrating to OpenRC 0.39+ from previous versions ===+===== Migrating to OpenRC 0.39+ from previous versions =====
  
-OpenRC 0.39, as shipped via [[https://slackbuilds.org/|SBo]], features 2 main changes:+OpenRC 0.39.2, as //**planned**// to be shipped via [[https://slackbuilds.org/|SBo]], features 2 main changes:
  
-  * **openrc-init** is being used as init instead of ///sbin/init//+  * //openrc-init// is being used as init instead of ///sbin/init//
   * Service and configuration directory has been changed to ///etc/openrc// instead of ///etc//   * Service and configuration directory has been changed to ///etc/openrc// instead of ///etc//
  
-Both these changes were done to have a clean{er} OpenRC install which can co-exist with other init systems like sysvinit (default), runit, etc, just by changing boot parameter.+Both these changes were done to have a clean{er} OpenRC install which can co-exist with other init systems like sysvinit (default), runit, etc, just by changing boot parameters.
  
-To change from ///etc/init.d// to ///etc/openrc/init.d//:+Following articles have more info:
  
-  # migrate existing services +  * [[https://docs.slackware.com/howtos:general_admin:openrc#openrc-init|To switch to openrc-init]] 
-  for service in /etc/init.d/*; do +  * [[https://docs.slackware.com/howtos:general_admin:openrc#migrating_from_etc_initd_to_etc_openrc_initd|To switch to /etc/openrc/init.d]]
-    svcname=$(basename "$service"+
-    if ! -e "/etc/openrc/init.d/${svcname}" ]; then +
-      if -f "/etc/init.d/${svcname}" ] && grep -q openrc "/etc/init.d/${svcname}"; then +
-        cp -v "/etc/init.d/${svcname}" "/etc/openrc/init.d/${svcname}" +
-      elif [ -L "/etc/init.d/${svcname}" ]; then +
-        # check if symlink is of a service +
-        service_target=$(readlink -f "$service"+
-        service_target_name=$(basename "$service_target"+
-        if [ $(dirname "$service_target") = "/etc/init.d" ]; then +
-          ln -sv "/etc/openrc/init.d/${service_target_name}" "/etc/openrc/init.d/${svcname}" +
-        fi +
-      fi +
-    fi +
-  done +
-   +
-  # enable existing services +
-  for runlevel in /etc/runlevels/*; do +
-    for service in ${runlevel}/*; do +
-      svcname=$(basename "$service"+
-      rvlname=$(basename "$runlevel"+
-      if ! -e /etc/openrc/runlevels/${rvlname}/${svcname} ] && -e /etc/openrc/init.d/${svcname} ]; then +
-        ln -sv /etc/openrc/init.d/${svcname} /etc/openrc/runlevels/${rvlname}/${svcname} +
-      fi +
-    done +
-  done +
-   +
-  check config changes +
-  for file in /etc/conf.d/*; do +
-    filename=$(basename "$file"+
-    extension="${filename##*.}" +
-    if [ "$extension" = orig ] || [ "$extension" == new ]; then +
-      continue  # dont need to check extra +
-    fi +
-    if [ -e "/etc/conf.d/${filename}" ] && [ -e "/etc/openrc/conf.d/${filename}" ]; then +
-      diff -Nupr "/etc/conf.d/${filename}" "/etc/openrc/conf.d/${filename}" +
-    fi +
-  done+
  
-Config changes found above can be updated by hand or copy pasted in new location.+===== dummy heading 1 =====
  
-After checking that things are working expected, old files and folders can be renamed (or removed).+added for generating toc
  
-  mv /etc/init.d /etc/init.d-openrc-bkp +===== dummy heading 2 =====
-  mv /etc/conf.d /etc/conf.d-openrc-bkp +
-  mv /etc/rc.conf /etc/rc.conf-openrc.bkp +
-  mv /etc/inittab /etc/inittab-openrc.bkp+
  
-Finally initial changes done by us can be reverted:+added for generating toc
  
-  mv /etc/init.d-bkp /etc/init.d +===== dummy heading 3 ===== 
-  mv /etc/inittab.sysvinit /etc/inittab+ 
 +added for generating toc
 talk:howtos:general_admin:openrc ()