Home | News | Download | Packages | Forum | Wiki | Github

How runit functions


#1

systemd asks programs to quit rather than forcing them to. I was wondering if runit does it in a similar way or does it the traditional way and signifies it’s going to then forces the program?

Also which way creates less problems?


(aleksey) #2

Dude, i feel like you’ve been a victim to some marketing or FUD. I might be wrong, but it sure feels like it.

There are no “two ways” to terminate a process in Linux, there is currently one and only way: to send a signal and this is what every init system would do.

First usually TERM signal is sent to a process, this signal is handled by process itself (and might be ignored by process), i guess this is what you mean by “asks programs to quit” and by “signifies it’s going to” (to whom?). Process might ignore TERM signal for different reasons, it might be difficult or it might be defunct, in some bad state when it can no longer work properly, or it wasn’t working properly to begin with.

If process is being difficult, then usually KILL signal is sent next, this signal is handled not by a process but by a kernel. If kernel “receives” such signal for a particular process, AFAIK it just erases this process and moves on.

kill sends TERM signal by default (man kill), if that doesn’t work, you could do kill -9, 9 is the number assigned to KILL signal and kill -9 is what people usually do when a process refuses to terminate.

man sv basically has all the answers for your questions. It says that sv down sends TERM and sv kill sends KILL. Does that answer your question?

Also which way creates less problems?

I wonder.


(maxice8's favorite salad) #3

Runit has good documentation http://smarden.org/runit/index.html


#4

Hi @femboyfoxthighhighs

Why not just say hello before asking questions? We are a family here and respect each other. :slight_smile:

But to your question: You should be more precise than just “How runit functions” … What exactly is your problem?

“How runit functions” is described here: https://wiki.voidlinux.eu/Runit and here a nice cookbook: https://supermarket.chef.io/cookbooks/runit.

Don’t forget: Google is your friend. :slight_smile:


(Erin) #5

The World Wide Web is your friend. Certain monolithic institutions upon it, less so.


#6

There is something systemd does at shutdown that is different :
https://manpages.debian.org/stretch/dracut-core/dracut-shutdown.service.8.en.html
I’m not sure what advantages that has and it is more related to unmounting things, but I wondered when I read it if it would bring a performance advantage in being able to unmount, switch to the ramdisk then complete shutdown or something.