Author Topic: Creating new runit service  (Read 71 times)


  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Creating new runit service
« on: Tue May 23 11:16:11 2023 »
Note: if creating folder for only one of them and it works you dont have to create for both.

First create a folder both at /lib/init/services/ and /etc/init/multi/
folder name should be service name

Code: [Select]
cd /lib/init/services/
sudo mkdir service_name_as_folder
cd service_name_as_folder
nano run
copy paste below
[ -e /run/dbus/system_bus_socket ] || exit 1
exec /usr/bin/service_name

then inside these folder you have created, you need to create a file named as run.

later put the code inside a file named as run. The code you need to put is at below.

example for dockerd;

Code: [Select]
[ -e /run/dbus/system_bus_socket ] || exit 1
exec /usr/bin/dockerd

Renember you can change this part of script
Code: [Select]
/usr/bin/dockerd like ---> /usr/bin/new_init_service
Code: [Select]
sv up folder_name_you_have_created to enable this service and well done.

I am Dengesiz Kokarca!

« Last Edit: Thu May 25 06:46:43 2023 by unbalancedskunk »