How to ask systemd to not start a system service on boot?start a service a at bootime in systemdHow can we mask service whose unit file is located under /etc/systemd/system?init service failing to enable once a systemd service file is generatedWhy is systemd stopping service immediately after it is started?Instruct to execute an unit after completing another unit successfullysystemd: finish the execution of custom shell script before starting nginxStopping systemd unit together with another. Starting worksConfused why systemd service doesn't start at bootStart systemd service with a “system” user to execute a bash scriptProblem starting Gunicorn Web Service using Systemd
Could there be a material that inverts the colours seen through it?
AMPScript Lookup From Child Business Unit
Why does SSL Labs now consider CBC suites weak?
How do I adjust encounters to challenge my lycanthrope players without negating their cool new abilities?
Was the dragon prowess intentionally downplayed in S08E04?
Why do the lights go out when someone enters the dining room on this ship?
Can I say: "When was your train leaving?" if the train leaves in the future?
Where to find every-day healthy food near Heathrow Airport?
How does this Martian habitat 3D printer built for NASA work?
Is it safe to use two single-pole breakers for a 240v circuit?
Offered a new position but unknown about salary?
Help understanding this line - usage of くれる
Why was my Canon Speedlite 600EX triggering other flashes?
Substring join or additional table, which is faster?
Extract the characters before last colon
Acronyms in HDD specification
Should generated documentation be stored in a Git repository?
Should I communicate in my applications that I'm unemployed out of choice rather than because nobody will have me?
What information exactly does an instruction cache store?
Smooth function that vanishes only on unit cube
Find the unknown area, x
Is this a group? If so, what group is it?
White foam around tubeless tires
Polynomial division: Is this trick obvious?
How to ask systemd to not start a system service on boot?
start a service a at bootime in systemdHow can we mask service whose unit file is located under /etc/systemd/system?init service failing to enable once a systemd service file is generatedWhy is systemd stopping service immediately after it is started?Instruct to execute an unit after completing another unit successfullysystemd: finish the execution of custom shell script before starting nginxStopping systemd unit together with another. Starting worksConfused why systemd service doesn't start at bootStart systemd service with a “system” user to execute a bash scriptProblem starting Gunicorn Web Service using Systemd
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I don't want to remove the service, I just want to avoid its start on boot. I still need the option to start it manually later (with the systemctl start <service>
command).
I tried to use systemctl disable <service>
. It doesn't work, because it removes the service.
There is another possibility. In its service file,
[Install]
#WantedBy=multi-user.target
could be commented out (and then, systemctl daemon-reload
). It works in the case of my own services, because their service files was written by me.
However, the service files belonging to distribution, are in /lib/systemd/system
. Files in this directory are managed by the OS, i.e. they would be overwritten by updates, other parts of the system might assume that these are unmodified, and so on. Simply editing system files out of the /etc
is a bad practice, and I don't want to do that. I don't want to edit configuration files in my /lib
.
What to do?
systemd
|
show 6 more comments
I don't want to remove the service, I just want to avoid its start on boot. I still need the option to start it manually later (with the systemctl start <service>
command).
I tried to use systemctl disable <service>
. It doesn't work, because it removes the service.
There is another possibility. In its service file,
[Install]
#WantedBy=multi-user.target
could be commented out (and then, systemctl daemon-reload
). It works in the case of my own services, because their service files was written by me.
However, the service files belonging to distribution, are in /lib/systemd/system
. Files in this directory are managed by the OS, i.e. they would be overwritten by updates, other parts of the system might assume that these are unmodified, and so on. Simply editing system files out of the /etc
is a bad practice, and I don't want to do that. I don't want to edit configuration files in my /lib
.
What to do?
systemd
1
usesystemctl disable <service>
– eblock
May 3 at 10:35
5
Why wouldsystemctl disable
remove a service? I never had that issue, disabling always worked for me. However, editing drop-in files in/etc/systemd/system
is actually the desired way, at least that's what I learned.
– eblock
May 3 at 10:52
@eblock Yes, it removes the service. After asystemctl disable <service>
, you won't be able to see it insystemctl --all
any more. You can enable it again if you wish, and the you can start it, but not this is what I want. I only want it to not start on boot (thus, to remove from the wishlist ofmulti-user.target
). Solving the problem on your way would be a workaround, not the solution. However, if there is no better option, I will need to do that.
– peterh
May 3 at 10:59
Check the output ofsystemctl disable <service>
and the existence of that unit file under/lib
. Normally it wouldn't be removed, if it really get removed, then you'll not be able to enable or start it again.systemctl --all
doesn't seem to be a valid syntax forsystemctl
.
– 炸鱼薯条德里克
May 3 at 11:40
@炸鱼薯条德里克systemctl --all
most definitely is a valid command.
– Stephen Kitt
May 3 at 11:41
|
show 6 more comments
I don't want to remove the service, I just want to avoid its start on boot. I still need the option to start it manually later (with the systemctl start <service>
command).
I tried to use systemctl disable <service>
. It doesn't work, because it removes the service.
There is another possibility. In its service file,
[Install]
#WantedBy=multi-user.target
could be commented out (and then, systemctl daemon-reload
). It works in the case of my own services, because their service files was written by me.
However, the service files belonging to distribution, are in /lib/systemd/system
. Files in this directory are managed by the OS, i.e. they would be overwritten by updates, other parts of the system might assume that these are unmodified, and so on. Simply editing system files out of the /etc
is a bad practice, and I don't want to do that. I don't want to edit configuration files in my /lib
.
What to do?
systemd
I don't want to remove the service, I just want to avoid its start on boot. I still need the option to start it manually later (with the systemctl start <service>
command).
I tried to use systemctl disable <service>
. It doesn't work, because it removes the service.
There is another possibility. In its service file,
[Install]
#WantedBy=multi-user.target
could be commented out (and then, systemctl daemon-reload
). It works in the case of my own services, because their service files was written by me.
However, the service files belonging to distribution, are in /lib/systemd/system
. Files in this directory are managed by the OS, i.e. they would be overwritten by updates, other parts of the system might assume that these are unmodified, and so on. Simply editing system files out of the /etc
is a bad practice, and I don't want to do that. I don't want to edit configuration files in my /lib
.
What to do?
systemd
systemd
edited May 3 at 10:41
peterh
asked May 3 at 10:24
peterhpeterh
4,559113462
4,559113462
1
usesystemctl disable <service>
– eblock
May 3 at 10:35
5
Why wouldsystemctl disable
remove a service? I never had that issue, disabling always worked for me. However, editing drop-in files in/etc/systemd/system
is actually the desired way, at least that's what I learned.
– eblock
May 3 at 10:52
@eblock Yes, it removes the service. After asystemctl disable <service>
, you won't be able to see it insystemctl --all
any more. You can enable it again if you wish, and the you can start it, but not this is what I want. I only want it to not start on boot (thus, to remove from the wishlist ofmulti-user.target
). Solving the problem on your way would be a workaround, not the solution. However, if there is no better option, I will need to do that.
– peterh
May 3 at 10:59
Check the output ofsystemctl disable <service>
and the existence of that unit file under/lib
. Normally it wouldn't be removed, if it really get removed, then you'll not be able to enable or start it again.systemctl --all
doesn't seem to be a valid syntax forsystemctl
.
– 炸鱼薯条德里克
May 3 at 11:40
@炸鱼薯条德里克systemctl --all
most definitely is a valid command.
– Stephen Kitt
May 3 at 11:41
|
show 6 more comments
1
usesystemctl disable <service>
– eblock
May 3 at 10:35
5
Why wouldsystemctl disable
remove a service? I never had that issue, disabling always worked for me. However, editing drop-in files in/etc/systemd/system
is actually the desired way, at least that's what I learned.
– eblock
May 3 at 10:52
@eblock Yes, it removes the service. After asystemctl disable <service>
, you won't be able to see it insystemctl --all
any more. You can enable it again if you wish, and the you can start it, but not this is what I want. I only want it to not start on boot (thus, to remove from the wishlist ofmulti-user.target
). Solving the problem on your way would be a workaround, not the solution. However, if there is no better option, I will need to do that.
– peterh
May 3 at 10:59
Check the output ofsystemctl disable <service>
and the existence of that unit file under/lib
. Normally it wouldn't be removed, if it really get removed, then you'll not be able to enable or start it again.systemctl --all
doesn't seem to be a valid syntax forsystemctl
.
– 炸鱼薯条德里克
May 3 at 11:40
@炸鱼薯条德里克systemctl --all
most definitely is a valid command.
– Stephen Kitt
May 3 at 11:41
1
1
use
systemctl disable <service>
– eblock
May 3 at 10:35
use
systemctl disable <service>
– eblock
May 3 at 10:35
5
5
Why would
systemctl disable
remove a service? I never had that issue, disabling always worked for me. However, editing drop-in files in /etc/systemd/system
is actually the desired way, at least that's what I learned.– eblock
May 3 at 10:52
Why would
systemctl disable
remove a service? I never had that issue, disabling always worked for me. However, editing drop-in files in /etc/systemd/system
is actually the desired way, at least that's what I learned.– eblock
May 3 at 10:52
@eblock Yes, it removes the service. After a
systemctl disable <service>
, you won't be able to see it in systemctl --all
any more. You can enable it again if you wish, and the you can start it, but not this is what I want. I only want it to not start on boot (thus, to remove from the wishlist of multi-user.target
). Solving the problem on your way would be a workaround, not the solution. However, if there is no better option, I will need to do that.– peterh
May 3 at 10:59
@eblock Yes, it removes the service. After a
systemctl disable <service>
, you won't be able to see it in systemctl --all
any more. You can enable it again if you wish, and the you can start it, but not this is what I want. I only want it to not start on boot (thus, to remove from the wishlist of multi-user.target
). Solving the problem on your way would be a workaround, not the solution. However, if there is no better option, I will need to do that.– peterh
May 3 at 10:59
Check the output of
systemctl disable <service>
and the existence of that unit file under /lib
. Normally it wouldn't be removed, if it really get removed, then you'll not be able to enable or start it again. systemctl --all
doesn't seem to be a valid syntax for systemctl
.– 炸鱼薯条德里克
May 3 at 11:40
Check the output of
systemctl disable <service>
and the existence of that unit file under /lib
. Normally it wouldn't be removed, if it really get removed, then you'll not be able to enable or start it again. systemctl --all
doesn't seem to be a valid syntax for systemctl
.– 炸鱼薯条德里克
May 3 at 11:40
@炸鱼薯条德里克
systemctl --all
most definitely is a valid command.– Stephen Kitt
May 3 at 11:41
@炸鱼薯条德里克
systemctl --all
most definitely is a valid command.– Stephen Kitt
May 3 at 11:41
|
show 6 more comments
1 Answer
1
active
oldest
votes
systemctl disable
is the correct way to do this; it still allows starting a unit manually, even if it doesn’t appear in systemctl --all
’s output — to list all startable units, you should run systemctl list-unit-files
instead. To render a unit un-startable, you need to mask
it.
$ sudo systemctl stop unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Fri 2019-05-03 13:12:41 CEST; 5s ago
Docs: man:unbound(8)
Main PID: 5320 (code=exited, status=0/SUCCESS)
$ sudo systemctl disable unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:unbound(8)
$ sudo systemctl start unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; disabled; vendor preset: enabled)
Active: active (running) since Fri 2019-05-03 13:13:14 CEST; 1s ago
Docs: man:unbound(8)
Process: 30513 ExecStartPre=/usr/lib/unbound/package-helper chroot_setup (code=exited, status=0/SUCCESS)
Process: 30518 ExecStartPre=/usr/lib/unbound/package-helper root_trust_anchor_update (code=exited, status=0/SUCCESS)
Main PID: 30525 (unbound)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/unbound.service
└─30525 /usr/sbin/unbound -d
If you really want to, you can override system-provided services defined in /lib
by adding files in /etc
, and change their desired target; systemctl edit yourunit
will do the right thing: it opens an editor, allowing you to override only the settings you care about, and it will store the result in the right place, as an override “snippet”. Updates made to non-overridden settings in the system-provided services (e.g. by package upgrades) will be taken into account transparently.
If I see it correctly,systemctl edit
actually creates some override file, is it true? I think, overridingWantedBy
to am empty string would a nice solution, without the duplication of the configuration from the /lib. Is it possible?
– peterh
May 3 at 11:26
Yes, that’s correct. But the correct solution really issystemctl disable
. (systemctl start
can start a unit which doesn’t appear insystemctl --all
.)
– Stephen Kitt
May 3 at 11:27
2
Andsystem list-unit-files
has also the disabled entries... wonderful. Somewhere I've read this: "Systemd is a quite good OS, only it requires some improvement in its boot mechanism." ;-)
– peterh
May 3 at 11:37
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f516925%2fhow-to-ask-systemd-to-not-start-a-system-service-on-boot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
systemctl disable
is the correct way to do this; it still allows starting a unit manually, even if it doesn’t appear in systemctl --all
’s output — to list all startable units, you should run systemctl list-unit-files
instead. To render a unit un-startable, you need to mask
it.
$ sudo systemctl stop unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Fri 2019-05-03 13:12:41 CEST; 5s ago
Docs: man:unbound(8)
Main PID: 5320 (code=exited, status=0/SUCCESS)
$ sudo systemctl disable unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:unbound(8)
$ sudo systemctl start unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; disabled; vendor preset: enabled)
Active: active (running) since Fri 2019-05-03 13:13:14 CEST; 1s ago
Docs: man:unbound(8)
Process: 30513 ExecStartPre=/usr/lib/unbound/package-helper chroot_setup (code=exited, status=0/SUCCESS)
Process: 30518 ExecStartPre=/usr/lib/unbound/package-helper root_trust_anchor_update (code=exited, status=0/SUCCESS)
Main PID: 30525 (unbound)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/unbound.service
└─30525 /usr/sbin/unbound -d
If you really want to, you can override system-provided services defined in /lib
by adding files in /etc
, and change their desired target; systemctl edit yourunit
will do the right thing: it opens an editor, allowing you to override only the settings you care about, and it will store the result in the right place, as an override “snippet”. Updates made to non-overridden settings in the system-provided services (e.g. by package upgrades) will be taken into account transparently.
If I see it correctly,systemctl edit
actually creates some override file, is it true? I think, overridingWantedBy
to am empty string would a nice solution, without the duplication of the configuration from the /lib. Is it possible?
– peterh
May 3 at 11:26
Yes, that’s correct. But the correct solution really issystemctl disable
. (systemctl start
can start a unit which doesn’t appear insystemctl --all
.)
– Stephen Kitt
May 3 at 11:27
2
Andsystem list-unit-files
has also the disabled entries... wonderful. Somewhere I've read this: "Systemd is a quite good OS, only it requires some improvement in its boot mechanism." ;-)
– peterh
May 3 at 11:37
add a comment |
systemctl disable
is the correct way to do this; it still allows starting a unit manually, even if it doesn’t appear in systemctl --all
’s output — to list all startable units, you should run systemctl list-unit-files
instead. To render a unit un-startable, you need to mask
it.
$ sudo systemctl stop unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Fri 2019-05-03 13:12:41 CEST; 5s ago
Docs: man:unbound(8)
Main PID: 5320 (code=exited, status=0/SUCCESS)
$ sudo systemctl disable unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:unbound(8)
$ sudo systemctl start unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; disabled; vendor preset: enabled)
Active: active (running) since Fri 2019-05-03 13:13:14 CEST; 1s ago
Docs: man:unbound(8)
Process: 30513 ExecStartPre=/usr/lib/unbound/package-helper chroot_setup (code=exited, status=0/SUCCESS)
Process: 30518 ExecStartPre=/usr/lib/unbound/package-helper root_trust_anchor_update (code=exited, status=0/SUCCESS)
Main PID: 30525 (unbound)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/unbound.service
└─30525 /usr/sbin/unbound -d
If you really want to, you can override system-provided services defined in /lib
by adding files in /etc
, and change their desired target; systemctl edit yourunit
will do the right thing: it opens an editor, allowing you to override only the settings you care about, and it will store the result in the right place, as an override “snippet”. Updates made to non-overridden settings in the system-provided services (e.g. by package upgrades) will be taken into account transparently.
If I see it correctly,systemctl edit
actually creates some override file, is it true? I think, overridingWantedBy
to am empty string would a nice solution, without the duplication of the configuration from the /lib. Is it possible?
– peterh
May 3 at 11:26
Yes, that’s correct. But the correct solution really issystemctl disable
. (systemctl start
can start a unit which doesn’t appear insystemctl --all
.)
– Stephen Kitt
May 3 at 11:27
2
Andsystem list-unit-files
has also the disabled entries... wonderful. Somewhere I've read this: "Systemd is a quite good OS, only it requires some improvement in its boot mechanism." ;-)
– peterh
May 3 at 11:37
add a comment |
systemctl disable
is the correct way to do this; it still allows starting a unit manually, even if it doesn’t appear in systemctl --all
’s output — to list all startable units, you should run systemctl list-unit-files
instead. To render a unit un-startable, you need to mask
it.
$ sudo systemctl stop unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Fri 2019-05-03 13:12:41 CEST; 5s ago
Docs: man:unbound(8)
Main PID: 5320 (code=exited, status=0/SUCCESS)
$ sudo systemctl disable unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:unbound(8)
$ sudo systemctl start unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; disabled; vendor preset: enabled)
Active: active (running) since Fri 2019-05-03 13:13:14 CEST; 1s ago
Docs: man:unbound(8)
Process: 30513 ExecStartPre=/usr/lib/unbound/package-helper chroot_setup (code=exited, status=0/SUCCESS)
Process: 30518 ExecStartPre=/usr/lib/unbound/package-helper root_trust_anchor_update (code=exited, status=0/SUCCESS)
Main PID: 30525 (unbound)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/unbound.service
└─30525 /usr/sbin/unbound -d
If you really want to, you can override system-provided services defined in /lib
by adding files in /etc
, and change their desired target; systemctl edit yourunit
will do the right thing: it opens an editor, allowing you to override only the settings you care about, and it will store the result in the right place, as an override “snippet”. Updates made to non-overridden settings in the system-provided services (e.g. by package upgrades) will be taken into account transparently.
systemctl disable
is the correct way to do this; it still allows starting a unit manually, even if it doesn’t appear in systemctl --all
’s output — to list all startable units, you should run systemctl list-unit-files
instead. To render a unit un-startable, you need to mask
it.
$ sudo systemctl stop unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Fri 2019-05-03 13:12:41 CEST; 5s ago
Docs: man:unbound(8)
Main PID: 5320 (code=exited, status=0/SUCCESS)
$ sudo systemctl disable unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:unbound(8)
$ sudo systemctl start unbound
$ sudo systemctl status unbound
● unbound.service - Unbound DNS server
Loaded: loaded (/lib/systemd/system/unbound.service; disabled; vendor preset: enabled)
Active: active (running) since Fri 2019-05-03 13:13:14 CEST; 1s ago
Docs: man:unbound(8)
Process: 30513 ExecStartPre=/usr/lib/unbound/package-helper chroot_setup (code=exited, status=0/SUCCESS)
Process: 30518 ExecStartPre=/usr/lib/unbound/package-helper root_trust_anchor_update (code=exited, status=0/SUCCESS)
Main PID: 30525 (unbound)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/unbound.service
└─30525 /usr/sbin/unbound -d
If you really want to, you can override system-provided services defined in /lib
by adding files in /etc
, and change their desired target; systemctl edit yourunit
will do the right thing: it opens an editor, allowing you to override only the settings you care about, and it will store the result in the right place, as an override “snippet”. Updates made to non-overridden settings in the system-provided services (e.g. by package upgrades) will be taken into account transparently.
edited May 3 at 11:31
answered May 3 at 11:15
Stephen KittStephen Kitt
185k26427508
185k26427508
If I see it correctly,systemctl edit
actually creates some override file, is it true? I think, overridingWantedBy
to am empty string would a nice solution, without the duplication of the configuration from the /lib. Is it possible?
– peterh
May 3 at 11:26
Yes, that’s correct. But the correct solution really issystemctl disable
. (systemctl start
can start a unit which doesn’t appear insystemctl --all
.)
– Stephen Kitt
May 3 at 11:27
2
Andsystem list-unit-files
has also the disabled entries... wonderful. Somewhere I've read this: "Systemd is a quite good OS, only it requires some improvement in its boot mechanism." ;-)
– peterh
May 3 at 11:37
add a comment |
If I see it correctly,systemctl edit
actually creates some override file, is it true? I think, overridingWantedBy
to am empty string would a nice solution, without the duplication of the configuration from the /lib. Is it possible?
– peterh
May 3 at 11:26
Yes, that’s correct. But the correct solution really issystemctl disable
. (systemctl start
can start a unit which doesn’t appear insystemctl --all
.)
– Stephen Kitt
May 3 at 11:27
2
Andsystem list-unit-files
has also the disabled entries... wonderful. Somewhere I've read this: "Systemd is a quite good OS, only it requires some improvement in its boot mechanism." ;-)
– peterh
May 3 at 11:37
If I see it correctly,
systemctl edit
actually creates some override file, is it true? I think, overriding WantedBy
to am empty string would a nice solution, without the duplication of the configuration from the /lib. Is it possible?– peterh
May 3 at 11:26
If I see it correctly,
systemctl edit
actually creates some override file, is it true? I think, overriding WantedBy
to am empty string would a nice solution, without the duplication of the configuration from the /lib. Is it possible?– peterh
May 3 at 11:26
Yes, that’s correct. But the correct solution really is
systemctl disable
. (systemctl start
can start a unit which doesn’t appear in systemctl --all
.)– Stephen Kitt
May 3 at 11:27
Yes, that’s correct. But the correct solution really is
systemctl disable
. (systemctl start
can start a unit which doesn’t appear in systemctl --all
.)– Stephen Kitt
May 3 at 11:27
2
2
And
system list-unit-files
has also the disabled entries... wonderful. Somewhere I've read this: "Systemd is a quite good OS, only it requires some improvement in its boot mechanism." ;-)– peterh
May 3 at 11:37
And
system list-unit-files
has also the disabled entries... wonderful. Somewhere I've read this: "Systemd is a quite good OS, only it requires some improvement in its boot mechanism." ;-)– peterh
May 3 at 11:37
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f516925%2fhow-to-ask-systemd-to-not-start-a-system-service-on-boot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
use
systemctl disable <service>
– eblock
May 3 at 10:35
5
Why would
systemctl disable
remove a service? I never had that issue, disabling always worked for me. However, editing drop-in files in/etc/systemd/system
is actually the desired way, at least that's what I learned.– eblock
May 3 at 10:52
@eblock Yes, it removes the service. After a
systemctl disable <service>
, you won't be able to see it insystemctl --all
any more. You can enable it again if you wish, and the you can start it, but not this is what I want. I only want it to not start on boot (thus, to remove from the wishlist ofmulti-user.target
). Solving the problem on your way would be a workaround, not the solution. However, if there is no better option, I will need to do that.– peterh
May 3 at 10:59
Check the output of
systemctl disable <service>
and the existence of that unit file under/lib
. Normally it wouldn't be removed, if it really get removed, then you'll not be able to enable or start it again.systemctl --all
doesn't seem to be a valid syntax forsystemctl
.– 炸鱼薯条德里克
May 3 at 11:40
@炸鱼薯条德里克
systemctl --all
most definitely is a valid command.– Stephen Kitt
May 3 at 11:41