void-runit icon indicating copy to clipboard operation
void-runit copied to clipboard

[RFC] Add oneshot capability

Open abenson opened this issue 6 years ago • 5 comments

This is a simple solution to address #23.

  • To disable a oneshot, simply chmod -x it. I guess a package would have to mark these as conf_files? That does mean if they are edited, that there will be extra files in there (XX-thing.sh.new-ver) but those won't match the glob and it should be fine.
  • I had suggested earlier there be "early boot" and "late boot" scripts, but given the nature of how runit starts services, this is silly since you can't really know if the services will all be started or not. This will suffice for the main use cases, which things like alsa and iptables.
  • I also had suggested earlier that locations like /etc/runit/oneshot be used, but /etc/rc.local.d is a thing on other distributions, so I think that's more of a normal location to go with.

Comments? Questions?

abenson avatar Oct 03 '19 16:10 abenson

I like the idea, but not the implementation. I'd rather have these live under /etc/runit and be part of the 1 and 3 scripts.

My 2 cents anyway.

the-maldridge avatar Oct 04 '19 01:10 the-maldridge

I also like the idea, but not the implementation. Putting this in /etc/runit/2 will block starting up, should the activation take time, or worst, hang forever. I have never liked systemd's A start job is running.

IMHO, making new services in runsvdir state, that sv down themselves after all of its sub-initialization done is better (I don't even sure if it's workable, I may try in this weekend).

sgn avatar Aug 20 '20 00:08 sgn

But the purpose of this is nothing more than to provide a mechanism for packages to add snippets to /etc/rc.{local,shutdown}. It's stuff you'd wind up putting there anyway.

This seems more robust than a service that sv downs itself.

ahesford avatar Aug 20 '20 01:08 ahesford

But the purpose of this is nothing more than to provide a mechanism for packages to add snippets to /etc/rc.{local,shutdown}. It's stuff you'd wind up putting there anyway.

This seems more robust than a service that sv downs itself.

I was talking about a service named oneshot in /etc/sv, that will activate a list of drop-in in some folder.

Talking about this, I think that service doesn't need to shut it down themselves, for running list of rc.shutdown on finish. So, wasting 1 do-nothing service, instead of multiple service.

sgn avatar Aug 20 '20 01:08 sgn

This is awesome! It is simple and flexible. Can this be merged? :)

basploeger avatar Apr 07 '22 07:04 basploeger

https://github.com/void-linux/void-runit/issues/23#issuecomment-1506310606

classabbyamp avatar Apr 13 '23 19:04 classabbyamp