[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Commands service and systemctl.



On Fri 14 Apr 2023 at 21:01:30 (-0700), peter@easthope.ca wrote:
>     From: David Wright <deblis@lionunicorn.co.uk>
>     Date: Fri, 14 Apr 2023 11:12:18 -0500
> > man 8 service
> 
> "SERVICE(8) ...
>  ...
> service  runs  a System V init script or systemd unit ..."
> 
> Initial release of System V was in 1983.  Initial release of systemd
> was in 2010.  Probably service predates systemd.

I'm not sure what you're reading into that. The bullseye manpage has
a copyright date of 2006 (Red Hat). But if we look at service itself,
which is a script, we can see that the ?earliest Debian version was
written in 2004 by our very own John Hasler, for sarge through lenny,
by which time the version we have now, I think, joins it, and replaces
it in squeeze.

As far as I can ascertain, I've never installed a package containing
/usr/sbin/service until it was moved into init-system-helpers in
stretch, and made a dependency of init.

> > service passes COMMAND  and OPTIONS to the init script unmodified.
> > For systemd units, start,  stop, status, and reload are passed through
> > to their systemctl/initctl equivalents.
> 
> For start, stop & etc. systemctl is more direct than service.  Might be
> some functionality from service not available from systemctl.  Have to
> dig deeper for that.

For systemctl, service is a wrapper, so I don't see how it would have
more functionality.

I can see why a script might use service to save knowing which init
system was being used to control a package, but other than that,
I can't see why one wouldn't just use the appropriate command for
each service.

> No mention that service will be outmoded by systemctl but appears so.

I don't see any evidence for that. Besides, if you decide to use
sysvinit or some other init system, why would you want to use
systemctl for anything?

Or perhaps you're talking about controlling /etc/init.d scripts on
a systemd system. AFAIK, systemctl does that tranparently through
systemd-sysv-install. AFAICT from ls, the only /e/i.d/ script I use
is anacron, and I don't think systemd will ever write a unit for that.

So I think I can safely say that I've never run service, wittingly or
unwittingly, in the decade or more that it was around. (Sorry, John.)

> > ... rather than a wiki webpage.
> 
> The table in https://en.wikipedia.org/wiki/Iproute2 is comprehensive
> and direct. Note heading "Utilities obsoleted ...".

So you asked, "Does the relationship between service and systemctl
parallel that between ifconfig and ip?", to which I would answer no.
AFAIK, while not obsolete, net-tools has been deprecated for years,
and can't be used for many tasks that ip can perform.

OTOH, service is designed to handle sysvinit scripts (and ones for
other init systems), and those init systems are still in active use.

> > ... wiki ...
> 
> Any J. Doe can correct an error in a wiki.  In many (most?) man pages
> deficiencies and errors endure.

But I don't know what the systemd wiki has to do with the service
command? You said it yourself: … many occurrences of "service",
none referring to the service command.

Cheers,
David.


Reply to: