[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
Last revisionBoth sides next revision
playground:runit [2018/12/19 20:17 (UTC)] – [9. run scripts] chrisabelaplayground:runit [2018/12/19 20:26 (UTC)] – [10. Migrating Services] chrisabela
Line 444: Line 444:
 ===== 10. Migrating Services ===== ===== 10. Migrating Services =====
  
-It is suggested that services are migrated from stage 2 (which are still under the Slackware’s BSD init scheme) to stage 3 carefully. Start from the end of /etc/rc.d/rc.M and work up. This means that you should start with any entries under /etc/rc.d/rc.local +It is suggested that services are migrated from stage 2 (which are still under the Slackware’s BSD init scheme) to stage 3 carefully. Start from the bottom of ''/etc/rc.d/rc.M'' and work up. This means that you should start with any entries under ''/etc/rc.d/rc.local'' 
  
-Then continue for /etc/rc.d/rc.S+Then continue for ''/etc/rc.d/rc.S''
  
-Proceed with other services to benefit’s from runit features. Note that for some services, such as atd and crond, you would need to edit /etc/rc.d/rc.M as they are hard-coded.+Proceed with other services to benefit’s from runit features. Note that for some services, such as ''atd'' and ''crond'', you would need to edit ''/etc/rc.d/rc.M'' as they are hard-coded.
  
-Let’s take the popular NetworkManager service as an example. According to the permission of /etc/rc.d/rc.networkmanager this script is called by /etc/rc.d/rc.M The latter is called by /etc/runit/2 (stage 2).+Let’s take the popular ''NetworkManager'' service as an example. According to the permission of ''/etc/rc.d/rc.networkmanager'' this script is called by ''/etc/rc.d/rc.M'' The latter is called by ''/etc/runit/2'' (stage 2).
  
 Stop the service: Stop the service:
  
 +<code>
 /etc/rc.d/rc.networkmanager stop /etc/rc.d/rc.networkmanager stop
 +</code>
  
 Disable it: Disable it:
  
 +<code>
 chmod -x /etc/rc.d/rc.networkmanager chmod -x /etc/rc.d/rc.networkmanager
 +</code>
  
 Create a suitable directory for runit Create a suitable directory for runit
  
 +<code>
 mkdir /etc/sv/networkmanager/ mkdir /etc/sv/networkmanager/
 +</code>
  
-Write a runit run script: /etc/sv/networkmanager/run+Write a runit run script: ''/etc/sv/networkmanager/run''
  
 +<code>
 #!/bin/sh #!/bin/sh
 prefix=/usr prefix=/usr
Line 474: Line 481:
 export XDG_CACHE_HOME=/root/.cache  export XDG_CACHE_HOME=/root/.cache 
 exec $NETWORKMANAGER_BIN -n > /dev/null 2>&1 exec $NETWORKMANAGER_BIN -n > /dev/null 2>&1
 +</code>
  
-Symlink it to /service and NetworkManager to enable under current runlevel and it will start in a few seconds:+Symlink the ''/etc/sv/networkmanager'' directory to ''/service'' to enable under current runlevel and it will start in a few seconds:
  
 +<code>
 ln -s /etc/sv/networkmanager /service ln -s /etc/sv/networkmanager /service
 +</code>
  
-For udev, it is stuggested to let it under runit’s stage 2, but you can setup its monitoring for stage 3. +For ''udev'', it is stuggested to let it under runit’s stage 2, but you can setup its monitoring for stage 3. 
  
 +===== 11 Sources =====
 + 
 +(1) http://smarden.org/runit/
  
-Sources:  +(2) https://slackbuilds.org
-http://smarden.org/runit/+
  
-https://slackbuilds.org+(3) https://en.wikipedia.org/wiki/Init
  
-https://en.wikipedia.org/wiki/Init+(4) https://voidlinux.org/usage/runit/
  
-https://voidlinux.org/usage/runit/+(5) https://www.youtube.com/watch?v=jiBlIhFxNJo
  
-https://www.youtube.com/watch?v=jiBlIhFxNJo+(6) http://kchard.github.io/runit-quickstart/
  
-http://kchard.github.io/runit-quickstart/+(7) https://www.slackbook.org/beta/
  
-https://www.slackbook.org/beta/+(8) https://gitlab.com/chrisabela/runit_scripts_for_slackware
  
-https://gitlab.com/chrisabela/runit_scripts_for_slackware+  * Written for Slackware 14.2 in December 2018 
 +  * Originally written by [[wiki:user:chrisabela | Chris Abela]] 
 +<!-- Please do not modify anything below, except adding new tags.--> 
 +{{tag>init runit}}
  
-Author: Chris Abela for Slackware 14.2 
-December 2018 
 playground:runit ()