Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
MacOS shutdown hook
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Raz0rEdge" data-source="post: 1770081" data-attributes="member: 110816"><p>OK, I see what you are trying..you said background process, if that is a shell script, one possibility is to trap the script being killed and then run a function where you logic resides. However, this is not a deterministic way of handling the case, i.e., the system is killing all running scripts and expects that to happen quickly and you can't too long or delay the shutdown, so it's possible that the computer will go down before you finish your "logic"..</p><p></p><p>Checkout this <a href="https://github.com/freedev/macosx-script-boot-shutdown" target="_blank">handy script</a> to see how it's done..</p></blockquote><p></p>
[QUOTE="Raz0rEdge, post: 1770081, member: 110816"] OK, I see what you are trying..you said background process, if that is a shell script, one possibility is to trap the script being killed and then run a function where you logic resides. However, this is not a deterministic way of handling the case, i.e., the system is killing all running scripts and expects that to happen quickly and you can't too long or delay the shutdown, so it's possible that the computer will go down before you finish your "logic".. Checkout this [URL="https://github.com/freedev/macosx-script-boot-shutdown"]handy script[/URL] to see how it's done.. [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
MacOS shutdown hook
Top