-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Works great with a little change in boot-shutdownscript.sh #9
Comments
Sorry ignore the above with the : . When a change the start shutdwon script to :
It works great however According trap command macos manual https://ss64.com/mac/trap.html The trap command does not work for SIGKILL (9) but by me I guess (did not test it yet) it works on the 15 SIGTERM . |
Hi @christophecvr, if you can please do your test and let me know if everything works well. |
Hello, Yes just tested and indeed on the SIGKILL signal (9) the trap command does not work. On SIGTERM (15) it does work perfect. For just reboot and shutdown. So indeed my script now is:
comment: I Think You could also use
When time permits I will try it out. |
As extra info I also activated the log function and used the /private/var/log made a map BOOTSHUTDOWN/ There both log and error are located. and can be seen it works perfect. with 15 SIGTERM.
tes |
Hi @freedev , now all test completed. By me it just works perfect. Macbookpro mid 2010 with 16 gb ram I7 double core(4 threads) processor updated HD ssd samsung 1 TB . Maybe very old but still perfect working was hardware from the days Steve Jobs was still with us. Unfortunately max macos is High Sierra 10.13.6 . Here my current perfect working version:
Logs:
So it works with SIGTERM or 15 may also be used. |
Hallo @freedev I also created script files for macos who will do the same but then at user login and logout. So then it's limited to specific user. What is interesting for mac pc's who have several users. see: |
Hi @christophecvr, if I compare the original source with the only change I see is that you have removed the |
Hi @freedev by me it did not worked at all in original version. There were 2 trap commands. on 2 lines. I think that was the reason why it did not worked on my macos high sierra (possible it well worked on older osx)
By removing the SIGKILL line it does work well (but I well relocated the trap above the functions line do not now if that is needed but in a couple of program examples on other stack excange sites they do it always like that). But it works perfect. By me with the boot-shutdown like I published at the end. |
Ok, thanks for sharing it. |
@freedev Yes I'm limited to High Sierra with my mac. You can try it on a higher MacOs . I now made the script to work user based as a LaunchAgent at login logout. The logout gives a SIGTERM so it works perfect. The advantage is that If there are several users on a same pc They can use it just for the user. Also the commands are with user rights. No need for sudo during install and or launching . |
Hi @freedev If You have time can you once test the macos-script-login-logout in you're mac. Would be nice if I know that this work still on higher MacOs versions then High Sierra 10.13.6 . It's on my github.com. It does contain a full automated install.sh script which can Install remove and or reinstall. It can run as source script or bash subshell script. The master is just the basic script. |
Hi @freedev I just double checked . At this time the boot shut down like it is here. Well it worked well now (must have done something wrong myself by the first install to the script) But its was a long time I worked with bash shell and especially on mac I worked before always on linux. Logging of the process
I'm now will try to make a good automated install file for this script also for boot shutdown like I did for the my login-logout-script . But bootshutdown is a system process not user . See if I can make one which needs to be run with sudo . Anyway this is a system process ideal for cleanup in system locations or whatever. While login logout is only for user processes. I will make this file in a forked git repo. |
Hi @freedev I just made a Automated (user install script for the macosx-script-boot-shutdown) . |
Hi by me at first the shutdown commands did not execute startup well. Im working with a macbookpro mid 2010 . High Sierra 10.13.6 (which is max os installable on my mac).
I just changed (think even corrected) the trap command from
trap shutdown SIGTERM
trap shutdown SIGKILL
TO
trap shutdown: SIGTERM
trap shutdown: SIGKILL
The ":" was I think just forgotten but it's needed for a function launch.
The text was updated successfully, but these errors were encountered: