<div dir="ltr"><div>We have an experimental 'svc' program that utilizes the new procctl() system call to control and keep track of services. start, stop, restart, etc. It still needs significant work such as a configuration file or directory (say, /etc/services, with individual files) where services can be specified, and an ability to run different scripts as part of a stop or restart sequence.<br><br></div>Ultimately the goal is to be able to configure jails with significant path and file writing restrictions, so the services can only read and write files that they actually need to read and write no matter what uid they are running as. That will need some major kernel components and probably also a UI requester component.<br><div><br>-Matt<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 17, 2014 at 9:31 PM, Robin Hahling <span dir="ltr"><<a href="mailto:robin.hahling@gw-computing.net" target="_blank">robin.hahling@gw-computing.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I usually am present in the IRC channel (as Rolinh) but people sometimes miss<br>
things that are discussed there. I thought that discussing things on the ML was<br>
a good idea in this regard.<br>
<br>
In this case, I missed the parts you are mentioning. If the consensus is that<br>
the service(8) command could go, then I am in favor of removing it from 4.0<br>
release. I believe it was discreetly added in 3.8.2 release and has not been<br>
advertised a lot. Then, the sooner we remove it, the less we have chances of<br>
disrupting users habits.<br>
<br>
As for the missing features from rcrun(8) with regard to service(8), having a<br>
quick look at it I see:<br>
<br>
* -e switch to list services that are enabled. rcrun(8) do have the 'list'<br>
argument but it lists all services, whether they are enabled or not only the<br>
ones that are enabled. This could be added easily.<br>
* -r switch, which is similar to 'rcrun list' but the output looks a bit<br>
different.<br>
* -R switch to restart all enabled local services.<br>
<br>
Is there something I am missing?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Mon, 17 Nov 2014 16:15:25 -0700<br>
"Samuel J. Greear" <<a href="mailto:sjg@evilcode.net">sjg@evilcode.net</a>> wrote:<br>
<br>
> A discussion along these lines occurred recently on the DragonFly BSD<br>
> developer IRC channel on EFNet, #dragonflybsd. The consensus was that the<br>
> service command could go, and that rcrun could use some improvements, the<br>
> service interface need not necessarily be maintained if rcrun can do all of<br>
> the same things.<br>
><br>
> You should pop into the IRC channel and continue this discussion, as well<br>
> as taking into account any other input on this email list.<br>
><br>
> Sam<br>
><br>
> On Mon, Nov 17, 2014 at 3:11 PM, Robin Hahling <<br>
> <a href="mailto:robin.hahling@gw-computing.net">robin.hahling@gw-computing.net</a>> wrote:<br>
><br>
> > service(8) was brought in past summer, from FreeBSD, as a way to control<br>
> > system<br>
> > services, as an interface to rc.d system. Since version 1.0 (December 2003<br>
> > to<br>
> > be exact), DragonFly has had rcrun(8) while service(8) was added to<br>
> > FreeBSD in<br>
> > December 2009.<br>
> ><br>
> > Having service(8) in DragonFly allow users or sysadmins to find their way<br>
> > around the system a but more quickly since service and its syntax is used<br>
> > in<br>
> > popular systems such as FreeBSD or even Red Hat and other distributions in<br>
> > the<br>
> > linux world. However, it would make sense to have service(8) implemented<br>
> > as a<br>
> > wrapper around rcrun(8) and not a program in itself for obvious reasons. I<br>
> > volunteer for the task if people agree with this idea but really, it<br>
> > should be<br>
> > a no brainer.<br>
> ><br>
> > While on the subject, rcrun(8) syntax needs to evolve in order to be able<br>
> > to<br>
> > pass arguments to rc scripts. Future bluetooth rc scripts will need it for<br>
> > instance. The current rcrun(8) syntax is the following:<br>
> ><br>
> > rcrun command script [script2] [script3] ...<br>
> ><br>
> > where 'command' is one of 'disable', 'start', etc. This syntax allows to<br>
> > apply<br>
> > the same operation to multiple rc scripts at once which is very handy (at<br>
> > least<br>
> > to me). Also, this kind of syntax is similar to the one used in systemd<br>
> > with<br>
> > the sysctl tool for instance. In this matter, service(8) syntax is<br>
> > different:<br>
> ><br>
> > service script command<br>
> ><br>
> > This syntax means that you cannot restart or do whatever command at once<br>
> > for<br>
> > multiple scripts. On the other hand, if we had to add the possibility to<br>
> > add<br>
> > arguments to the script this could be easily done this way:<br>
> ><br>
> > service script command arg1 arg2 ...<br>
> ><br>
> > So I tried to think about a syntax for rcrun(8) that would allow it to pass<br>
> > arguments while still being able to apply a command to multiple scripts at<br>
> > once. This is the idea that came to my mind: add a prefix to arguments so<br>
> > as<br>
> > to differentiate arguments from scripts names. For instance:<br>
> ><br>
> > rcrun command script1 :arg1 :arg2 script2 script3 :arg1 :arg2<br>
> ><br>
> > In this example, ":" is used as the arguments prefix. I see several<br>
> > advantages<br>
> > to this syntax:<br>
> ><br>
> > * It is retro-compatible to current rcrun(8) syntax meaning that it won't<br>
> > break<br>
> > users's own scripts or workflow.<br>
> > * It allies best of both worlds (service(8) and rcrun(8) current syntax).<br>
> > * It is easy to implement.<br>
> ><br>
> > If someone has an other/better idea, I would like to hear about it. If, on<br>
> > the<br>
> > other hand it reaches a consensus, then I volunteer for this task too.<br>
> > However, there are more things I would need to know about before<br>
> > processing.<br>
> > procctl(2) and some other features were added recently and I would need to<br>
> > know<br>
> > where this is going and what changes it'll bring to rcrun(8) and all of<br>
> > what it<br>
> > implies (parallel starting of services, and so on).<br>
> ><br>
> > Robin Hahling (Rolinh)<br>
> ><br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Robin Hahling <<a href="mailto:robin.hahling@gw-computing.net">robin.hahling@gw-computing.net</a>><br>
</font></span></blockquote></div><br></div>