[LEDE-DEV] can I have some feedback about a wrapper to call initscripts

Alberto Bursi alberto.bursi at outlook.it
Tue Nov 22 13:59:04 PST 2016



On 11/22/2016 11:12 AM, Karl Palsson wrote:
>
>
> If it looks like debian and out of date unsupported
> centos/redhat, but is actually completely different, is it really
> helpful to make it look like something it's not?
>

Well, some secondary options (that can be added if someone thinks are 
really necessary) are currently missing as I don't see a real need for 
them. (the "get status of all services" argument for example, never used 
it on servers, usually you need to know what a single service is up to, 
not look at a list of all services)

Some other features of original "service" (init script isolation) are 
irrelevant in LEDE as the initscripts here are written for procd.

But apart from that it is still pretty much the same thing, a wrapper to 
call initscripts without typing the full path. Hence I took the name.

Anyway as I said the main thing I wanted was removing the "having to 
type the full path" part.

I'm open to better suggestions.

> The life of the "service <xxxx> start|stop|status" really wasn't
> very long. It didn't offer command completion without shell
> programming, and was simply a rewording of /etc/init.d/xxxx
> start|stop|status. Redhat based distros moved to systemd, ubuntu
> went to upstart, and that changed things _again_

Ok, "service" is now mostly obsoleted with sysV/initscripts but the 
general concept behind it isn't.
(btw, "service" was used for Ubuntu/Upstart too until its switch to 
systemd, as Upstart was still using init scripts)

-Systemd (used in most distros) does not require people to type full 
paths to start/stop services.

-Gentoo (no systemd by default, uses OpenRC, still scripts) is using a 
tool called "rc-update" (since more than a decade ago).

-here in OpenWRT/LEDE there are complex tools like uci to configure the 
system and its daemons, and I remember of people talking about 
converting the current text config files to JSON eventually (i.e. not 
easily editable anymore with text editor)

I thought it was sensible to assume that many people prefer using some 
kind of tool/wrapper instead of calling scripts with full path (like me).

The name can be changed, "service" was just what I thought would be most 
fitting in this case.

> Why should
> openwrt _add_ a duplicate path that needs to be documented and
> adds little to no value?
>

Other than simple consistency (see above), it would be better for people 
that don't know what a init script is.

For people that don't have the muscle memory of decades of linux (or 
people that learned linux later and/or used "service" or systemd), 
remembering and typing a directory path with slashes and alien names 
isn't cool.
Tab completion does not really help much here (it is useful afterwards).

As for the "duplicate paths issue", I was (perhaps naively) planning to 
simply change default recommended command to reload services to the new 
wrapper in the wiki once the change was merged (and stating the current 
one was deprecated while unlikely to be dropped for obvious reasons), 
but I didn't anticipate this would be a hot topic.
I only expected to be corrected on formal issues (like moving the 
wrapper to an alias).

-Alberto



More information about the Lede-dev mailing list