What does launchctl unload actually do?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
2
down vote
favorite
When running launchctl unload some.plist
, what is this command translated to specifically, in terms of UNIX commands, etc.
There is nothing in .plist
files that specifies any "command line to run when the user specifies unload", so does macOS simply send a kill
signal to the process? Or what does it do?
launchd
add a comment |Â
up vote
2
down vote
favorite
When running launchctl unload some.plist
, what is this command translated to specifically, in terms of UNIX commands, etc.
There is nothing in .plist
files that specifies any "command line to run when the user specifies unload", so does macOS simply send a kill
signal to the process? Or what does it do?
launchd
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
When running launchctl unload some.plist
, what is this command translated to specifically, in terms of UNIX commands, etc.
There is nothing in .plist
files that specifies any "command line to run when the user specifies unload", so does macOS simply send a kill
signal to the process? Or what does it do?
launchd
When running launchctl unload some.plist
, what is this command translated to specifically, in terms of UNIX commands, etc.
There is nothing in .plist
files that specifies any "command line to run when the user specifies unload", so does macOS simply send a kill
signal to the process? Or what does it do?
launchd
asked 12 hours ago
forthrin
1,00241429
1,00241429
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
6
down vote
SIGTERM
launchd's unload
command sends a SIGTERM signal to the associated job's child processes.
Detached Processes
If a process launched by a launchd job has detached from it's parent process, then unload
will not affect that process. This is often the case for daemonised processes.
Original Source Code
You can download and inspect the original launchd source code. launchd
has since been rewritten and is proprietary to Apple but the original documents the intended behaviour on unload
.
Very good answer! So it'sSIGTERM
, then. My next question is whether there's a standard UNIX (or macOS) way to know when a stopping a daemon has been completely finalised, because the prompt doesn't wait for that, does it? I'll be happy to post a new question about that if it doesn't fit within the scope of this question.
â forthrin
11 hours ago
1
A modern UNIX process can usekqueue
to be notified when a process terminates, see stackoverflow.com/questions/22960188 and Chrome's kill_mac.cc source. For more detailed answers and to ask for shell specific answers, please ask a new question.
â Graham Miln
11 hours ago
add a comment |Â
up vote
1
down vote
To best answer this question we can look at two things: UNIX commands and what is in a .plist.
Starting out with a .plist, the following code is usually there
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>someApplication</string>
</dict>
</plist>
The CFBundleExecutable identifies the name of the bundleâÂÂs main executable file. For an app, this is the app executable. For a loadable bundle, it is the binary that will be loaded dynamically by the bundle.
So typing launchctl unload some.plist
will tell MacOS the key to locate the bundleâÂÂs executable file and 'unload' it or essentially kill it from the system.
This is telling it at an application level.
When using a UNIX command such as kill <PID>
it is in reference to a specific process.
Looking at what is a Process vs Application here is good reading
You can read further into what is in .plists and how they work over at Apple
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
SIGTERM
launchd's unload
command sends a SIGTERM signal to the associated job's child processes.
Detached Processes
If a process launched by a launchd job has detached from it's parent process, then unload
will not affect that process. This is often the case for daemonised processes.
Original Source Code
You can download and inspect the original launchd source code. launchd
has since been rewritten and is proprietary to Apple but the original documents the intended behaviour on unload
.
Very good answer! So it'sSIGTERM
, then. My next question is whether there's a standard UNIX (or macOS) way to know when a stopping a daemon has been completely finalised, because the prompt doesn't wait for that, does it? I'll be happy to post a new question about that if it doesn't fit within the scope of this question.
â forthrin
11 hours ago
1
A modern UNIX process can usekqueue
to be notified when a process terminates, see stackoverflow.com/questions/22960188 and Chrome's kill_mac.cc source. For more detailed answers and to ask for shell specific answers, please ask a new question.
â Graham Miln
11 hours ago
add a comment |Â
up vote
6
down vote
SIGTERM
launchd's unload
command sends a SIGTERM signal to the associated job's child processes.
Detached Processes
If a process launched by a launchd job has detached from it's parent process, then unload
will not affect that process. This is often the case for daemonised processes.
Original Source Code
You can download and inspect the original launchd source code. launchd
has since been rewritten and is proprietary to Apple but the original documents the intended behaviour on unload
.
Very good answer! So it'sSIGTERM
, then. My next question is whether there's a standard UNIX (or macOS) way to know when a stopping a daemon has been completely finalised, because the prompt doesn't wait for that, does it? I'll be happy to post a new question about that if it doesn't fit within the scope of this question.
â forthrin
11 hours ago
1
A modern UNIX process can usekqueue
to be notified when a process terminates, see stackoverflow.com/questions/22960188 and Chrome's kill_mac.cc source. For more detailed answers and to ask for shell specific answers, please ask a new question.
â Graham Miln
11 hours ago
add a comment |Â
up vote
6
down vote
up vote
6
down vote
SIGTERM
launchd's unload
command sends a SIGTERM signal to the associated job's child processes.
Detached Processes
If a process launched by a launchd job has detached from it's parent process, then unload
will not affect that process. This is often the case for daemonised processes.
Original Source Code
You can download and inspect the original launchd source code. launchd
has since been rewritten and is proprietary to Apple but the original documents the intended behaviour on unload
.
SIGTERM
launchd's unload
command sends a SIGTERM signal to the associated job's child processes.
Detached Processes
If a process launched by a launchd job has detached from it's parent process, then unload
will not affect that process. This is often the case for daemonised processes.
Original Source Code
You can download and inspect the original launchd source code. launchd
has since been rewritten and is proprietary to Apple but the original documents the intended behaviour on unload
.
edited 11 hours ago
answered 12 hours ago
Graham Miln
24.6k55784
24.6k55784
Very good answer! So it'sSIGTERM
, then. My next question is whether there's a standard UNIX (or macOS) way to know when a stopping a daemon has been completely finalised, because the prompt doesn't wait for that, does it? I'll be happy to post a new question about that if it doesn't fit within the scope of this question.
â forthrin
11 hours ago
1
A modern UNIX process can usekqueue
to be notified when a process terminates, see stackoverflow.com/questions/22960188 and Chrome's kill_mac.cc source. For more detailed answers and to ask for shell specific answers, please ask a new question.
â Graham Miln
11 hours ago
add a comment |Â
Very good answer! So it'sSIGTERM
, then. My next question is whether there's a standard UNIX (or macOS) way to know when a stopping a daemon has been completely finalised, because the prompt doesn't wait for that, does it? I'll be happy to post a new question about that if it doesn't fit within the scope of this question.
â forthrin
11 hours ago
1
A modern UNIX process can usekqueue
to be notified when a process terminates, see stackoverflow.com/questions/22960188 and Chrome's kill_mac.cc source. For more detailed answers and to ask for shell specific answers, please ask a new question.
â Graham Miln
11 hours ago
Very good answer! So it's
SIGTERM
, then. My next question is whether there's a standard UNIX (or macOS) way to know when a stopping a daemon has been completely finalised, because the prompt doesn't wait for that, does it? I'll be happy to post a new question about that if it doesn't fit within the scope of this question.â forthrin
11 hours ago
Very good answer! So it's
SIGTERM
, then. My next question is whether there's a standard UNIX (or macOS) way to know when a stopping a daemon has been completely finalised, because the prompt doesn't wait for that, does it? I'll be happy to post a new question about that if it doesn't fit within the scope of this question.â forthrin
11 hours ago
1
1
A modern UNIX process can use
kqueue
to be notified when a process terminates, see stackoverflow.com/questions/22960188 and Chrome's kill_mac.cc source. For more detailed answers and to ask for shell specific answers, please ask a new question.â Graham Miln
11 hours ago
A modern UNIX process can use
kqueue
to be notified when a process terminates, see stackoverflow.com/questions/22960188 and Chrome's kill_mac.cc source. For more detailed answers and to ask for shell specific answers, please ask a new question.â Graham Miln
11 hours ago
add a comment |Â
up vote
1
down vote
To best answer this question we can look at two things: UNIX commands and what is in a .plist.
Starting out with a .plist, the following code is usually there
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>someApplication</string>
</dict>
</plist>
The CFBundleExecutable identifies the name of the bundleâÂÂs main executable file. For an app, this is the app executable. For a loadable bundle, it is the binary that will be loaded dynamically by the bundle.
So typing launchctl unload some.plist
will tell MacOS the key to locate the bundleâÂÂs executable file and 'unload' it or essentially kill it from the system.
This is telling it at an application level.
When using a UNIX command such as kill <PID>
it is in reference to a specific process.
Looking at what is a Process vs Application here is good reading
You can read further into what is in .plists and how they work over at Apple
add a comment |Â
up vote
1
down vote
To best answer this question we can look at two things: UNIX commands and what is in a .plist.
Starting out with a .plist, the following code is usually there
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>someApplication</string>
</dict>
</plist>
The CFBundleExecutable identifies the name of the bundleâÂÂs main executable file. For an app, this is the app executable. For a loadable bundle, it is the binary that will be loaded dynamically by the bundle.
So typing launchctl unload some.plist
will tell MacOS the key to locate the bundleâÂÂs executable file and 'unload' it or essentially kill it from the system.
This is telling it at an application level.
When using a UNIX command such as kill <PID>
it is in reference to a specific process.
Looking at what is a Process vs Application here is good reading
You can read further into what is in .plists and how they work over at Apple
add a comment |Â
up vote
1
down vote
up vote
1
down vote
To best answer this question we can look at two things: UNIX commands and what is in a .plist.
Starting out with a .plist, the following code is usually there
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>someApplication</string>
</dict>
</plist>
The CFBundleExecutable identifies the name of the bundleâÂÂs main executable file. For an app, this is the app executable. For a loadable bundle, it is the binary that will be loaded dynamically by the bundle.
So typing launchctl unload some.plist
will tell MacOS the key to locate the bundleâÂÂs executable file and 'unload' it or essentially kill it from the system.
This is telling it at an application level.
When using a UNIX command such as kill <PID>
it is in reference to a specific process.
Looking at what is a Process vs Application here is good reading
You can read further into what is in .plists and how they work over at Apple
To best answer this question we can look at two things: UNIX commands and what is in a .plist.
Starting out with a .plist, the following code is usually there
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>someApplication</string>
</dict>
</plist>
The CFBundleExecutable identifies the name of the bundleâÂÂs main executable file. For an app, this is the app executable. For a loadable bundle, it is the binary that will be loaded dynamically by the bundle.
So typing launchctl unload some.plist
will tell MacOS the key to locate the bundleâÂÂs executable file and 'unload' it or essentially kill it from the system.
This is telling it at an application level.
When using a UNIX command such as kill <PID>
it is in reference to a specific process.
Looking at what is a Process vs Application here is good reading
You can read further into what is in .plists and how they work over at Apple
answered 12 hours ago
akostar
1196
1196
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fapple.stackexchange.com%2fquestions%2f332931%2fwhat-does-launchctl-unload-actually-do%23new-answer', 'question_page');
);
Post as a guest
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
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
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