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

Re: Default & supported service manager in Wheezy



Scott Ferguson <scott.ferguson.debian.user@gmail.com> writes:

> On 09/05/14 16:19, Mihamina Rakotomandimby wrote:
>> Hi all,
>> 
>> A long time ago, when I was young ;-), services used to be managed with
>> "invoke-rc.d" & "update-rc.d" on Debian.
>> 
>> Know playing with several distributions, some use "service", "sysctl",
>> "systemctl", and some of them are mentionned for managing services in
>> Debian.
>> 
>> Typically, on a Debian when I "a2ensite", there is a message indicating
>> to "service apache2 reload" in order to fullfill the new VirtualHost
>> consideration.
>> 
>> I would like to stick with the "native" tools for each distribution I
>> manage: On Wheezy what is the right one? What is wrapping what?
>
> Good question to which I'd like to know a definitive answer.
>
> Where the service exists in `ls /etc/init.d` I control
> (start/stop/restart/status whatever the service allows) it from there.
>

Using the service command is better than running scripts from
/etc/init.d because the service command will create a predictable
environment (clear environment variables, change working directory to /,
etc.).  Running scripts from /etc/init.d directly results in your user
environment variables leaking into daemons' environments, which can
result in hard-to-diagnose problems.

Also, the service command will be setup to automatically redirect to any
init-system-specific commands, so it will continue to work as it is even
if you move to a different init system.

-- 
regards,
kushal

Attachment: pgp3yiA4jwQRM.pgp
Description: PGP signature


Reply to: