On Thu, 22 Mar 2018 17:37:36 +0100
Martin Steigerwald <mar...@lichtvoll.de> wrote:

> Hello KatolaZ.
> 
> KatolaZ - 22.03.18, 15:40:
> > On Thu, Mar 22, 2018 at 02:00:23PM +0100, Martin Steigerwald
> > wrote:  
> […]
> > > I am working on updating my fio debian package. I chose to
> > > install the systemd service file for those who use a default
> > > Debian system with systemd.
> > > 
> > > However I also like to provide an init script for people who use
> > > Devuan or Debian with sysvinit.  
> […]
> > > I started a quick hack on an init script, but seems
> > > start-stop-daemon does not really work as I thought it would.
> > > 
> > > I attach my attempt to create an init script.  
> > 
> > It looks to me like you need to specify both "--server" and
> > "--daemonize" as options to fio, otherwise it won't launch itself
> > as a backend server. But I am not an expert of fio...  
> 
> And you are completely right. I didn´t know fio had this option.
> 
> So I was able to shorten the init script to:
> 
> DESC="Flexible I/O Tester as service"
> DAEMON=/usr/bin/fio
> DAEMON_ARGS='--server --daemonize /run/fio.pid'
> PIDFILE='/run/fio.pid'
> 
> and in the process also improve the systemd service file, I adapted
> from what was in the upstream source as an example.
> 
> Now I just need to dig out how to integrate the init script, but I
> think its a simple override of dh_installinit with "--no-enable" as a
> parameter. I do not want the service to run by default.
> 
> Thanks for your remark that helped to improve that package even
> further.
> 
> BTW: I also accept other configuration files of other init, as long
> as someone writes and tests them. Maybe I can go by example here and
> show that it is possible to have init freedom in packages I
> maintain. :)
> 
> Thanks,

I don't have a Devuan VM initted by runit, so the following info would
need to be tested by someone who does.

Assuming fio is to be run as root group root, which I infer from your
message, the run script in the service directory looks like the
following:


#!/bin/sh
exec /usr/bin/fio --server

If your --server needs any args, they should appear after --server. DO
NOT use --daemonize in runit: runit handles backgrounding by itself.

Because you don't want this thing to start on boot, place an empty
file called "down" inside the service directory. That way the admin
will need to start up the daemon explicitly.

Like I say, I don't have the setup to test this thing, but it can
probably help somebody who does.

HTH,

SteveT

Steve Litt 
April 2018 featured book: Troubleshooting Techniques
     of the Successful Technologist
http://www.troubleshooters.com/techniques
_______________________________________________
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng

Reply via email to