Some background first:
After discovering that NuTyX offer the runit init system I wanted to share a small tutorial how to create an new runit service.
Setting Up NuTyX:
To be able to use runit as init system on NuTyX, we need to change the default init system (http://the%20default%20init%20system). Note that on NuTyX runit programm is named runyx.
Onces you did all the changes as explain in the tuto above, you are now ready to reboot and create a new runit service.
Files and Folders locations:
- The /lib/init/services/ folder contains all the services directory that comes with every specific packages.
- The /etc/init folder contains the different run mode directories (single or multi) and a link to the current running mode.
The dockerd example:
cd /lib/init/services/
sudo mkdir dockerd
cd dockerd
We now create a file called run
with following contents:
#!/bin/sh
[ -e /run/dbus/system_bus_socket ] || exit 1
exec /usr/bin/dockerd
Make sure the run file is executable:
sudo chmod 755 run
Start the dockerd example service:
In runit (or runyx) world to start a service we simply create a new link to the desire run mode (single or multi). In our example let's start dockerd when we are in multimode.
sudo ln -sv /lib/init/services/dockerd /etc/init/multi/dockerd
Dockerd service is now up and running
Stop the dockerd example service:
To stop the service you simply remove the link just created.
sudo rm /etc/init/multi/dockerd
Note that you simply remove the link and not the script it self
I am Dengesiz Kokarca!
Review and correct by Thierry ;)