Re: [gentoo-user] Re: Non-opnerc init scripts

2018-05-21 Thread Rich Freeman
On Mon, May 21, 2018 at 3:43 PM Ian Zimmerman  wrote:

> openrc scripts have their own "API".  Converting a straight sysvinit
> script into an openrc one takes some work.  Look at some existing
> openrc script to see the kind of work that is needed.


Unless the upstream script does quite a bit you're usually better off
starting with a generic OpenRC init.d script and just tweaking it vs trying
to convert a non-openrc script into an openrc one.

Another option is to just create an openrc script wrapper that just calls
the upstream one, which is installed elsewhere.

Ideally though you want to get pid files and such to show up in the right
place.  However, if this is for oss I'm not sure you're even launching any
daemons vs just setting mixer levels and such.  If you aren't actually
leaving any processes running calling the upstream script from a wrapper
should be pretty harmless.  I haven't used openrc since it got cgroup
support but I suspect it is better about cleaning up orphans these days as
well.

-- 
Rich



[gentoo-user] Re: Non-opnerc init scripts

2018-05-21 Thread Ian Zimmerman
On 2018-05-21 19:22, Klaus Ethgen wrote:

> I use oss4 directly from upstream now. It comes with an legacy init
> script that works well with `/etc/init.d/oss start` (however, it has
> no status).
> 
> I added it to the "default" runlevel but unfortunately, openrc does
> not even try to start it.

openrc scripts have their own "API".  Converting a straight sysvinit
script into an openrc one takes some work.  Look at some existing
openrc script to see the kind of work that is needed.

A quick workaround is to just put your oss script under /etc/local.d
with a name ending in ".start".

-- 
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet and on broken lists
which rewrite From, fetch the TXT record for no-use.mooo.com.