[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 revisionBoth sides next 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:10 (UTC)] – add links to wiki section for migration aaditya
Line 25: Line 25:
 === 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+, as //**planned**// 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 +  * To switch to openrc-init[[https://docs.slackware.com/howtos:general_admin:openrc#openrc-init|openrc-init]] 
-  for service in /etc/init.d/*; do +  * To switch to /etc/openrc/init.d[[https://docs.slackware.com/howtos:general_admin:openrc#migrating_from_etc_initd_to_etc_openrc_initd|migrating_from_etc_initd_to_etc_openrc_initd]]
-    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. +
- +
-After checking that things are working expected, old files and folders can be renamed (or removed). +
- +
-  mv /etc/init.d /etc/init.d-openrc-bkp +
-  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: +
- +
-  mv /etc/init.d-bkp /etc/init.d +
-  mv /etc/inittab.sysvinit /etc/inittab+
 talk:howtos:general_admin:openrc ()