On Sat, Jan 07, 2017 at 09:16:58PM +0100, Pali Rohár wrote:
> That sounds strange as calling init script is standard way how to start 
> or stop some service in Linux and Unix world for a very long time...

No, calling init scripts directly brings only pain given that you'll
leak your environment into the daemon.

Consider an admin loggin in on a server using his personal account
where he has for example the locale set up to his preferred
language eg. greek, he then continues to su to gain root, then
he invokes /etc/init.d/foo restart.
This results in system logs being filled up with greek messages
which the other admins while investigating the system logs
can't read/understand.

To make an attempt at preventing atleast some of the environment
leakage the 'service' command was born a decade or two ago.
This is the proper interface for a local sysadmin to use
to manage services.

(Also, people want to *always* use 'su - foo' rather than just 'su foo'
to get a new environment for the new user, rather than inheriting the
previous environment.)

On the debian side we have Debian Policy 9.3.3 explicitly forbidding
directly invoking init scripts. That's what the abstraction layer
invoke-rc.d is for (which is basically the service command extended
with policy-rc.d support).

No packages in debian directly invokes init scripts. Users have
had a decade or two to learn about the service command (which
in turn runs systemctl on a systemd based system). Given we've
already given decades as a grace period for users to catch up,
it'll soon be time to turn up the heat on getting users to
do it right....

Under systemd, you really want to use systemctl (which service does
under the hood) to manage services. Anything started directly
and forks processes will leave those processes outside the
correct cgroup and then systemd can't track and kill them properly.
Having systemd start things via systemctl will also guarantee
that the services are started under a clean environment that
is the same every time. No environment leakage or variable
preconditions.


> 
> Anyway, I uploaded new llmnrd version 0.2.1-2 to mentors which should 
> address this bug: https://mentors.debian.net/package/llmnrd
> 
> I added also "try-restart" action, I believe logic is correct.

Looks good, uploaded.

Regards,
Andreas Henriksson

Reply via email to