The officially official Devuan Forum!

You are not logged in.

#1 2022-03-22 14:48:20

Geoff 42
Member
Registered: 2016-12-15
Posts: 462  

[SOLVED] Runit - sym-linking sv

xen services seem a bit tricky to set up as it does some setting up and then runs 3 daemons.
If the OS is not running under the Xen hypervisor, then the SysV init script exits.
When I try and do this under Runit, the run script exits, looping once a second.

Can I get Runit to run the old SysV init script?

The man page says :-

The sv program can be sym-linked to /etc/init.d/ to provide an LSB init script interface. The service to be controlled then is specified by the base name of the ‘‘init script’’.

I don't know how to interpret that, so I'll tried this :-

cd /etc/service
ln -s /usr/bin/sv xen
ls -alF xen
lrwxrwxrwx 1 root root   11 Mar 22 10:32 xen -> /usr/bin/sv*

and the xen script exists in /etc/init.d

ls -alF /etc/init.d/xen
-rwxr-xr-x 1 root root 7929 Jul 10  2021 /etc/init.d/xen*

Test to see if it works :-

sv status xen
fail: xen: unable to change to service directory: not a directory

So, no, that is not the way to do it and it may well be that this would never do what I was after,
but I really don't understand the man page bit about sym-linking to /etc/init.d. Does anyone?

Offline

#2 2022-03-22 15:41:43

xinomilo
Unknown
Registered: 2017-07-02
Posts: 315  

Re: [SOLVED] Runit - sym-linking sv

never used xen, so not sure i understand correctly, is there a xen runscript available that is not working?
if you want to use the sysv script maybe this helps : https://salsa.debian.org/runit-team/run … ian/README
* readme mentions how to switch from sysv script first then how to switch back.. you probably want the latter (?)

2c

Offline

#3 2022-03-22 16:47:58

Geoff 42
Member
Registered: 2016-12-15
Posts: 462  

Re: [SOLVED] Runit - sym-linking sv

OK, thank you for that link. I think it is saying that Runit still requires a proper Runit setup for the service, but you can have it controlled as though it were a SysV init script.

I have not found a Runit setup for xen and have been trying to convert the SysV init script into a Runit run script. To stop it looping I have added

sv once xen

which has the desired effect of stopping the looping when it is not booted on Xen, but more testing is required ;-)

Geoff

Offline

#4 2022-03-23 14:57:55

Geoff 42
Member
Registered: 2016-12-15
Posts: 462  

Re: [SOLVED] Runit - sym-linking sv

I have now got a run script working for Xen and will report separately.

The use of sym-linking sv, taken from the link xinomilo gave above, seems to be as follows, assuming you have the foo daemon (food) working via a Runit run file :-

/etc/init.d/food stop
dpkg-divert --add /etc/init.d/food
mv /etc/init.d/food /etc/init.d/food.distrib &&
   ln -s /usr/bin/sv /etc/init.d/food
update-service --add /etc/sv/food

you can then use either of the following styles of command :-

sv status food

or

/etc/init.d/food status

to access the foo service under Runit.

Geoff

Offline

Board footer