Disable "auto enable" of a service

Kernels & Hardware, configuring network, installing services

Disable "auto enable" of a service

Postby Snake94 » 2018-03-01 16:46

Good afternoon

I noticed that when I install a package that corresponds to a service, such as the apache web server, the service is automatically activated, as if I were doing a "systemctl enable apache2"
Is there any way to disable said "auto-enabled service"?
I honestly do not like that in my system services are activated automatically just by installing a package.

Thank you.
User avatar
Snake94
 
Posts: 21
Joined: 2016-06-05 10:48

Re: Disable "auto enable" of a service

Postby Head_on_a_Stick » 2018-03-01 16:54

Snake94 wrote:I honestly do not like that in my system services are activated automatically just by installing a package

+1

I presume that you are asking how to disable the default and already know to run `systemctl disable foo.service`?

The only answer I can give you is to switch to Arch, Alpine Linux or OpenBSD instead because they don't auto-enable services on installation.

I would be interested to hear of any method to allow that under Debian though.
dbruce wrote:Ubuntu forums try to be like a coffee shop in Seattle. Debian forums strive for the charm and ambience of a skinhead bar in Bacau. We intend to keep it that way.
User avatar
Head_on_a_Stick
 
Posts: 8324
Joined: 2014-06-01 17:46
Location: /dev/chair


Re: Disable "auto enable" of a service

Postby Head_on_a_Stick » 2018-03-01 17:36

^ That's just a GUI frontend for `systemctl` (I think), but it is very nice :)

There may be some dpkg option buried away somewhere but I can't get to the Debian box atm.

EDIT: here's Debian's version of that GUI:

https://packages.debian.org/stretch/systemd-ui
dbruce wrote:Ubuntu forums try to be like a coffee shop in Seattle. Debian forums strive for the charm and ambience of a skinhead bar in Bacau. We intend to keep it that way.
User avatar
Head_on_a_Stick
 
Posts: 8324
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Disable "auto enable" of a service

Postby bw123 » 2018-03-01 17:48

Snake94 wrote:
I honestly do not like that in my system services are activated automatically just by installing a package.



I was annoyed by it at first, because on sysV there used to be some that were, and some that were not and we all got along pretty well? I am pretty sure you can still do that if you want, but it would be up to the package to provide the /etc/default/ file for setting it up that way?

But really, just think how much time it would take when building a system to enable them all. It might be cool to have a way to toggle it off and on, but I really think the way it is now makes good sense.
User avatar
bw123
 
Posts: 3584
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Disable "auto enable" of a service

Postby Snake94 » 2018-03-01 17:59

Head_on_a_Stick wrote:
Snake94 wrote:I honestly do not like that in my system services are activated automatically just by installing a package

+1

I presume that you are asking how to disable the default and already know to run `systemctl disable foo.service`?

The only answer I can give you is to switch to Arch, Alpine Linux or OpenBSD instead because they don't auto-enable services on installation.

I would be interested to hear of any method to allow that under Debian though.


Thanks for response.

Archlinux is nice (I used archlinux for years on desktop) but is unstable, Arch is not fine for workstation if you want a stable system and for servers better not to mention, Alpine I've never used it, and OpenBSD/FreeBSD are very very nice for system administration/servers, but I use debian on my class laptop... *BSD on my laptop hardware runs very slow.

I do not really understand the reason for activating a service automatically, so much work is writing "systemctl enable foobar.service"?
User avatar
Snake94
 
Posts: 21
Joined: 2016-06-05 10:48

Re: Disable "auto enable" of a service

Postby Head_on_a_Stick » 2018-03-01 18:01

Snake94 wrote:I do not really understand the reason for activating a service automatically, so much work is writing "systemctl enable foobar.service"?

Well, as bw123 notes it does make sense in the context of a low-maintenance Debian stable system — why would you install a package if you do not want the corresponding service enabled?
dbruce wrote:Ubuntu forums try to be like a coffee shop in Seattle. Debian forums strive for the charm and ambience of a skinhead bar in Bacau. We intend to keep it that way.
User avatar
Head_on_a_Stick
 
Posts: 8324
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Disable "auto enable" of a service

Postby Snake94 » 2018-03-01 18:14

Head_on_a_Stick wrote:
Snake94 wrote:I do not really understand the reason for activating a service automatically, so much work is writing "systemctl enable foobar.service"?

Well, as bw123 notes it does make sense in the context of a low-maintenance Debian stable system — why would you install a package if you do not want the corresponding service enabled?


Just to have more control of my system, anyway, I understand what you want to say.
User avatar
Snake94
 
Posts: 21
Joined: 2016-06-05 10:48

Re: Disable "auto enable" of a service

Postby bw123 » 2018-03-01 18:19

for example, which ones should be 'off' and which should be ON, how about cron/anacron? What about sshd? what about display manager? sound support? Who gets to decide what should be default on?

How in the world could you make it work for everybody, when the only real choices are automatically 'on' or 'off' ?
User avatar
bw123
 
Posts: 3584
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Disable "auto enable" of a service

Postby Snake94 » 2018-03-01 19:03

bw123 wrote:for example, which ones should be 'off' and which should be ON, how about cron/anacron? What about sshd? what about display manager? sound support? Who gets to decide what should be default on?

How in the world could you make it work for everybody, when the only real choices are automatically 'on' or 'off' ?


Every service must be disabled for default like archlinux and other systems IMHO
User avatar
Snake94
 
Posts: 21
Joined: 2016-06-05 10:48


Return to System configuration

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable