1

I installed runit-2.1.2 on my ubuntu box,

And, I Created very simple streaming service as below,

mkdir -p /etc/sv/streaming/
echo 'echo "streaming" >> /var/log/streaming.log' > /etc/sv/streaming/run

Then, created symlink to /etc/service/streaming,

ln -s /etc/sv/streaming /etc/service/streaming

As, I can see below, symlink is created,

root@moby:/# ll /etc/service/streaming
lrwxrwxrwx 1 root root 17 Dec  2 00:27 /etc/service/streaming -> /etc/sv/streaming/

Waited 5 secs, nothing happens.

I also tried manually as below,

root@moby:/# sv status /etc/service/streaming     
warning: /etc/service/streaming: unable to open supervise/ok: file does not exist

I'm using ubuntu 16.04

root@moby:/# cat /etc/*release | grep RELEASE
DISTRIB_RELEASE=16.04

I feel like runit is not running at all.

root@moby:/# ps -ef | grep runsvdir
root      1976     7  0 00:58 ?        00:00:00 grep --color=auto runsvdir

I don't know the script to start runit either,

root@moby:/# service runit start
runit: unrecognized service

or

root@moby:/# service sv status
sv: unrecognized service

Can runit users help me know what's going on here?

Reference

http://smarden.org/runit/install.html

prayagupa
  • 121
  • 1
  • 6
  • Why don't you just create a systemd unit for your _real_ service? – Michael Hampton Dec 02 '16 at 01:15
  • @MichaelHampton Well, I am having issue with systemD too. `$ systemctl enable streaming Failed to execute operation: No such file or directory`. Here's my systemD unit - https://gist.github.com/prayagupd/f48900fd7f6b0f9d0a2f840db60469e1#systemd – prayagupa Dec 02 '16 at 07:31

2 Answers2

0

I solved this problem by adding the following files, inspired by the configuration for a previously running runit server on Ubuntu 16.04 LTS:

vagrant@vagrant:/usr/bin$ ls -l runsvdir-start* -rwxr-xr-x 1 root root 544 Aug 19 05:04 runsvdir-start

contents:

#!/bin/sh

PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin

exec env - PATH=$PATH \
runsvdir -P /etc/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'

and

vagrant@vagrant:/usr/bin$ ls -l /lib/systemd/system/runit.service -rw-r--r-- 1 root root 143 Aug 19 05:07 /lib/systemd/system/runit.service

[Unit]
Description=Runit service supervision

[Service]
ExecStart=/usr/bin/runsvdir-start
Restart=always

[Install]
WantedBy=multi-user.target

You may want to confirm paths with which runsvdir and this after an apt-get install runit.

JL Peyret
  • 115
  • 6
0

I have had the same issue on ubuntu 18.04. I was getting the following error while executing "sv status dir_name"

unable to open supervise/ok: file does not exist

The runsvdir is also not showing up in "grep" output. I have solved the issue by installing runit-systemd package. Please use the following command to install in ubuntu and debian systems

sudo apt install runit-systemd

I have found this solution from another askubuntu question

I hope this helps

Kumaran
  • 151
  • 2