[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
Next revisionBoth sides next revision
howtos:general_admin:openrc [2018/11/07 07:18 (UTC)] – [Migrating from /etc/init.d to /etc/openrc/init.d] this change is not required to swtich init via boot parameter aadityahowtos:general_admin:openrc [2018/11/29 18:53 (UTC)] – [openrc-init] add ingo to reload boot config aaditya
Line 34: Line 34:
  
 It may show a warning about deprecated support for ///etc/mtab// as a file, and how to correct it: It may show a warning about deprecated support for ///etc/mtab// as a file, and how to correct it:
-  # cp /etc/mtab /etc/mtab.bak+  # cp /etc/mtab /etc/mtab.bkp
   # ln -snf /proc/self/mounts /etc/mtab   # ln -snf /proc/self/mounts /etc/mtab
      
Line 136: Line 136:
 ====== openrc-init ====== ====== openrc-init ======
  
-Since version **0.25**, openrc provides //openrc-init// which can be used to directly boot the system.+Since version **0.25**, openrc provides //openrc-init// which can be used to boot the system
 + 
 +This allows switching between OpenRC and other init systems, for example sysvinit, just by changing boot parameters.
  
 To use it, To use it,
  
-Revert inittab changes done+=== Revert inittab changes done ===
  
   cp /etc/inittab /etc/inittab-openrc.bkp   cp /etc/inittab /etc/inittab-openrc.bkp
   mv /etc/inittab.sysvinit /etc/inittab   mv /etc/inittab.sysvinit /etc/inittab
      
-Setup the agetty services+=== Setup the agetty services ===
  
   # main tty   # main tty
Line 167: Line 169:
   echo 'agetty_options="--noclear"' >> /etc/conf.d/agetty.ttyS0   echo 'agetty_options="--noclear"' >> /etc/conf.d/agetty.ttyS0
  
-Add the following to your boot parameters (via ///etc/lilo.conf// for lilo or ///etc/default/grub// for grub):+=== Update boot parameters === 
 + 
 +Add the following to your boot parameters (via ///etc/lilo.conf// for lilo or ///etc/default/grub// for grub):
   init=/sbin/openrc-init   init=/sbin/openrc-init
  
-Note- To shutdown or reboot, one will need to use **openrc-shutdown**. To shutdown from a desktop environment using ConsoleKit2, check out this [[https://github.com/ConsoleKit2/ConsoleKit2/pull/113|PR]].+Regenerate boot configuration ('lilo -v' or 'grub-mkconfig -o /boot/grub/grub.cfg'). 
 + 
 +=== Shutdown/reboot === 
 + 
 +To shutdown or reboot, one will need to use **openrc-shutdown**. To shutdown from a desktop environment using ConsoleKit2, check out this [[https://github.com/ConsoleKit2/ConsoleKit2/pull/113|PR]].
  
 For more info, check out the [[https://wiki.gentoo.org/wiki/OpenRC#openrc-init|Gentoo wiki]]. For more info, check out the [[https://wiki.gentoo.org/wiki/OpenRC#openrc-init|Gentoo wiki]].
Line 188: Line 196:
 === 2. Migrate existing services === === 2. Migrate existing services ===
  
-This involves steps:+This involves steps:
  
   # migrate existing services   # migrate existing services
Line 227: Line 235:
     if [ -e "/etc/conf.d/${filename}" ] && [ -e "/etc/openrc/conf.d/${filename}" ]; then     if [ -e "/etc/conf.d/${filename}" ] && [ -e "/etc/openrc/conf.d/${filename}" ]; then
       diff -Nupr "/etc/conf.d/${filename}" "/etc/openrc/conf.d/${filename}"       diff -Nupr "/etc/conf.d/${filename}" "/etc/openrc/conf.d/${filename}"
 +    fi
 +  done
 +  # main config file
 +  diff -Nupr /etc/rc.conf /etc/openrc/rc.conf
 +  
 +  # check local.d changes
 +  for file in /etc/local.d/*; do
 +    filename=$(basename "$file")
 +    if [ ! -e "/etc/openrc/local.d/${filename}" ]; then
 +      cp -v "/etc/local.d/${filename}" "/etc/openrc/local.d/${filename}"
 +    elif [ -e "/etc/local.d/${filename}" ] && [ -e "/etc/openrc/local.d/${filename}" ]; then
 +      # show changes
 +      diff -Nupr "/etc/local.d/${filename}" "/etc/openrc/local.d/${filename}"
     fi     fi
   done   done
Line 232: Line 253:
 Config changes found above can be updated by hand or copy pasted in new location. Config changes found above can be updated by hand or copy pasted in new location.
  
-=== 3. Reboot and check ===+=== 3. Check and reboot === 
 + 
 +Verify if ''rc-status'' is showing all services (it may show them as stopped). 
 + 
 +Reboot and check whether things are working expected, make changes as necessary.
  
-After rebooting and checking whether things are working expected, old files and folders can be renamed (or removed).+The old files and folders can be renamed (or removed).
  
   mv /etc/init.d /etc/init.d-openrc-bkp   mv /etc/init.d /etc/init.d-openrc-bkp
   mv /etc/conf.d /etc/conf.d-openrc-bkp   mv /etc/conf.d /etc/conf.d-openrc-bkp
 +  mv /etc/local.d /etc/local.d-openrc-bkp
 +  mv /etc/runlevels /etc/runlevels-openrc-bkp
   mv /etc/rc.conf /etc/rc.conf-openrc.bkp   mv /etc/rc.conf /etc/rc.conf-openrc.bkp
  
 howtos:general_admin:openrc ()