Skip to content
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

soft shutdown not working on macOS Sonoma 14.2.1 #77

Open
samxplogs opened this issue Feb 18, 2024 · 37 comments
Open

soft shutdown not working on macOS Sonoma 14.2.1 #77

samxplogs opened this issue Feb 18, 2024 · 37 comments
Assignees

Comments

@samxplogs
Copy link

Dear Team,

The soft shutdown is not working on macOS Sonoma 14.2.1

I am running buskill-v0.7.0 using root like this

sudo open "/Applications/buskill-v0.7.0.app"

Could you have a look ? Thanks

Here is the full debug log with several attempts

12:55:17,549 root INFO ===============================================================================
12:55:17,550 root INFO INFO: Writing to log file '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/buskill.log'
12:55:17,550 root DEBUG BUSKILL_VERSION|{'VERSION': 'v0.7.0', 'GITHUB_REF': 'refs/heads/v0.7.0', 'GITHUB_SHA': '4139a515ea941dba3fffe5714226b135569f46e2', 'SOURCE_DATE_EPOCH': '1687039680'}|
12:55:17,550 root DEBUG os.environ|environ({'USER': 'dh', 'COMMAND_MODE': 'unix2003', '__CFBundleIdentifier': 'buskill-v0.7.0', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'LOGNAME': 'dh', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.HjiPsXX67p/Listeners', 'HOME': '/Users/dh', 'SHELL': '/bin/zsh', 'TMPDIR': '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'XPC_SERVICE_NAME': 'application.buskill-v0.7.0.18450406.18450465', 'XPC_FLAGS': '0x0', 'KIVY_DATA_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/data', 'KIVY_MODULES_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/modules', 'GST_REGISTRY_FORK': 'no', 'GST_PLUGIN_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app/Contents/MacOS/gst-plugins', 'GST_REGISTRY': '/Applications/buskill-v0.7.0.app/Contents/MacOS/registry.bin', 'GST_PLUGIN_SYSTEM_PATH': ''})|
12:55:17,550 root DEBUG sys.argv|['/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill']|
12:55:17,550 root DEBUG sys.builtin_modules_names|('_abc', '_ast', '_codecs', '_collections', '_functools', '_imp', '_io', '_locale', '_operator', '_signal', '_sre', '_stat', '_string', '_symtable', '_thread', '_tracemalloc', '_warnings', '_weakref', 'atexit', 'builtins', 'errno', 'faulthandler', 'gc', 'itertools', 'marshal', 'posix', 'pwd', 'sys', 'time', 'xxsubtype', 'zipimport')|
12:55:17,550 root DEBUG sys.executable|/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill|
12:55:17,550 root DEBUG sys.path|['/Applications/buskill-v0.7.0.app/Contents/MacOS/base_library.zip', '/Applications/buskill-v0.7.0.app/Contents/MacOS/lib-dynload', '/Applications/buskill-v0.7.0.app/Contents/MacOS']|
12:55:17,550 root DEBUG sys.prefix|/Applications/buskill-v0.7.0.app/Contents/MacOS|
12:55:17,550 root DEBUG sys.version|3.7.8 (default, Jul 4 2020, 10:17:17)
[Clang 11.0.3 (clang-1103.0.32.62)]|
12:55:17,550 root DEBUG sys.api_version|1013|
12:55:17,550 root DEBUG sys.version_info|sys.version_info(major=3, minor=7, micro=8, releaselevel='final', serial=0)|
12:55:17,550 root DEBUG name|main|
12:55:17,550 root DEBUG sys.platform|darwin|
12:55:17,573 root DEBUG platform.platform()|Darwin-23.2.0-x86_64-i386-64bit|
12:55:17,574 root DEBUG platform.system()|Darwin|
12:55:17,574 root DEBUG platform.release()|23.2.0|
12:55:17,574 root DEBUG platform.version()|Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.32/RELEASE_ARM64_T8103|
12:55:17,574 root DEBUG platform.machine()|x86_64|
12:55:17,574 root DEBUG platform.uname()|uname_result(system='Darwin', node='Ss-MacBook-Air.local', release='23.2.0', version='Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.3
2/RELEASE_ARM64_T8103', machine='x86_64', processor='i386')|
12:55:17,574 root DEBUG platform.mac_ver()|('10.16', ('', '', ''), 'x86_64')|
12:55:17,575 root INFO buskill version {'VERSION': 'v0.7.0', 'GITHUB_REF': 'refs/heads/v0.7.0', 'GITHUB_SHA': '4139a515ea941dba3fffe5714226b135569f46e2', 'SOURCE_DATE_EPOCH': '1687039680'}
12:55:17,575 packages.buskill DEBUG DEBUG: EXECUTED_AS_SCRIPT:|False|
DEBUG: EXE_PATH:|/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill|
DEBUG: EXE_DIR:|/Applications/buskill-v0.7.0.app/Contents/MacOS|
DEBUG: EXE_FILE:|buskill|
DEBUG: APP_DIR:|/Applications/buskill-v0.7.0.app|
DEBUG: APPS_DIR:|/Applications|
DEBUG: SRC_DIR:|/Applications/buskill-v0.7.0.app/Contents/MacOS|
DEBUG: os.environ['PATH']:|/usr/bin:/bin:/usr/sbin:/sbin:/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app|

12:55:17,576 packages.buskill INFO INFO: using DATA_DIR:|/Applications/.buskill|
12:55:17,577 packages.buskill DEBUG DEBUG: CONF_FILE:|/Applications/.buskill/config.ini|

12:55:17,590 kivy INFO [Logger ] Record log in /Applications/.buskill/logs/kivy_24-02-18_0.txt
12:55:17,589 kivy INFO [Kivy ] v1.11.1
12:55:17,590 kivy INFO [Kivy ] Installed at "/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy/init.pyc"
12:55:17,590 kivy INFO [Python ] v3.7.8 (default, Jul 4 2020, 10:17:17)
[Clang 11.0.3 (clang-1103.0.32.62)]
12:55:17,590 kivy INFO [Python ] Interpreter at "/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill"
12:55:17,636 kivy INFO [Factory ] 184 symbols loaded
12:55:17,921 kivy INFO [Image ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
12:55:18,142 kivy INFO [Window ] Provider: sdl2
12:55:19,146 kivy INFO [GL ] Using the "OpenGL ES 2" graphics system
12:55:19,147 kivy INFO [GL ] Backend used
12:55:19,148 kivy INFO [GL ] OpenGL version <b'2.1 Metal - 88'>
12:55:19,148 kivy INFO [GL ] OpenGL vendor <b'Apple'>
12:55:19,148 kivy INFO [GL ] OpenGL renderer <b'Apple M1'>
12:55:19,148 kivy INFO [GL ] OpenGL parsed version: 2, 1
12:55:19,148 kivy INFO [GL ] Shading version <b'1.20'>
12:55:19,149 kivy INFO [GL ] Texture max size <16384>
12:55:19,149 kivy INFO [GL ] Texture max units <16>
12:55:19,239 kivy INFO [Window ] auto add sdl2 input provider
12:55:19,358 kivy INFO [Window ] virtual keyboard not allowed, single mode, not docked
12:55:19,380 kivy INFO [Text ] Provider: sdl2
12:55:19,387 kivy INFO [Clipboard ] Provider: sdl2(['clipboard_nspaste'] ignored)
12:55:19,468 kivy INFO [GL ] NPOT texture support is available
12:55:19,519 buskill_gui DEBUG DEBUG: adding screen:||
12:55:19,520 buskill_gui DEBUG DEBUG: User switched to 'MainWindow' screen
12:55:19,520 buskill_gui DEBUG DEBUG: adding screen:||
12:55:19,520 buskill_gui DEBUG DEBUG: adding screen:||
12:55:19,650 kivy INFO [Base ] Start application main loop
12:55:24,319 buskill_gui DEBUG DEBUG: User switched to 'Settings' screen
12:55:26,317 buskill_gui DEBUG DEBUG: User switched to 'setting_trigger' screen
12:55:28,227 buskill_gui DEBUG DEBUG: Option already equals 'soft-shutdown'. Returning.
12:55:29,676 buskill_gui DEBUG DEBUG: User switched to 'Settings' screen
12:55:30,481 buskill_gui DEBUG DEBUG: User switched to 'MainWindow' screen
12:55:30,482 packages.buskill DEBUG DEBUG: Attempting to set 'trigger' set to 'soft-shutdown'
12:55:30,482 packages.buskill DEBUG DEBUG: Called spawn_root_child()
12:55:30,482 packages.buskill DEBUG DEBUG: No root_child detected. Attempting to spawn one.
12:55:30,482 packages.buskill INFO INFO: You have requested BusKill to do something that requires elevated privliges on your platform. If you'd like to proceed, please authorize BusKill to preform actions as Administrator. Your system may prompt you for your password to proceed.
12:55:30,482 packages.buskill DEBUG DEBUG: root_child_path:|/Applications/buskill-v0.7.0.app/Contents/MacOS/root_child_mac|
12:55:30,483 packages.buskill ERROR ERROR: root_child is not owned by gid=0 nor your group. Refusing to spawn script as root!
12:55:30,483 packages.buskill INFO INFO: BusKill 'trigger' set to 'soft-shutdown'
12:55:32,155 packages.buskill DEBUG DEBUG: attempting to arm BusKill via <bound method BusKill.armNix of <packages.buskill.BusKill object at 0x10b063dd0>>() with the 'soft-shutdown' trigger
12:55:32,168 kivy WARNING stderr: [DEBUG/MainProcess] created semlock with handle 22
12:55:32,178 kivy WARNING stderr: [DEBUG/MainProcess] created semlock with handle 23
12:55:32,179 kivy WARNING stderr: [DEBUG/MainProcess] created semlock with handle 25
12:55:32,179 kivy WARNING stderr: [DEBUG/MainProcess] Queue._after_fork()
12:55:32,182 packages.buskill DEBUG DEBUG:getstate() pre:dict_keys(['CURRENT_PLATFORM', 'KERNEL_VERSION', 'IS_PLATFORM_SUPPORTED', 'OS_NAME_SHORT', 'ERR_PLATFORM_NOT_SUPPORTED', 'ARM_FUNCTION', 'DISARM_FUNCTION', 'TRIGGER_FUNCTION', 'SIMULATE_HOTPLUG_REMOVAL', 'EXECUTED_AS_SCRIPT', 'LOG_FILE_PATH', 'EXE_PATH', 'EXE_DIR', 'EXE_FILE', 'APP_DIR', 'APPS_DIR', 'SRC_DIR', 'DATA_DIR', 'CACHE_DIR', 'CONF_FILE', 'GNUPGHOME', 'UPGRADED_FROM', 'UPGRADED_TO', 'root_child', 'is_armed', 'usb_handler', 'usb_handler_queue', 'upgrade_status_msg', 'upgrade_result', 'trigger', 'SUPPORTED_TRIGGERS', 'trigger_softshutdown_lin_shutdown_path', 'trigger_softshutdown_lin_poweroff_path', 'trigger_softshutdown_lin_systemctl_path', 'url_website', 'url_documentation', 'url_documentation_contribute', 'url_documentation_bug_report', 'url_documentation_gui'])|
12:55:32,182 packages.buskill DEBUG DEBUG:getstate() post:|dict_keys(['CURRENT_PLATFORM', 'KERNEL_VERSION', 'IS_PLATFORM_SUPPORTED', 'OS_NAME_SHORT', 'ERR_PLATFORM_NOT_SUPPORTED', 'ARM_FUNCTION', 'DISARM_FUNCTION', 'TRIGGER_FUNCTION', 'SIMULATE_HOTPLUG_REMOVAL', 'EXECUTED_AS_SCRIPT', 'LOG_FILE_PATH', 'EXE_PATH', 'EXE_DIR', 'EXE_FILE', 'APP_DIR', 'APPS_DIR', 'SRC_DIR', 'DATA_DIR', 'CACHE_DIR', 'CONF_FILE', 'GNUPGHOME', 'UPGRADED_FROM', 'UPGRADED_TO', 'is_armed', 'usb_handler_queue', 'upgrade_status_msg', 'upgrade_result', 'trigger', 'SUPPORTED_TRIGGERS', 'trigger_softshutdown_lin_shutdown_path', 'trigger_softshutdown_lin_poweroff_path', 'trigger_softshutdown_lin_systemctl_path', 'url_website', 'url_documentation', 'url_documentation_contribute', 'url_documentation_bug_report', 'url_documentation_gui'])|
12:55:32,190 packages.buskill INFO INFO: BusKill is armed. Listening for removal event.
INFO: To disarm the CLI, exit with ^C or close this terminal
12:55:32,512 root INFO ===============================================================================
12:55:32,512 root INFO ===============================================================================
12:55:32,512 root INFO INFO: Writing to log file '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/buskill.log'
12:55:32,512 root INFO INFO: Writing to log file '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/buskill.log'
12:55:32,512 root DEBUG BUSKILL_VERSION|{'VERSION': 'v0.7.0', 'GITHUB_REF': 'refs/heads/v0.7.0', 'GITHUB_SHA': '4139a515ea941dba3fffe5714226b135569f46e2', 'SOURCE_DATE_EPOCH': '1687039680'}|
12:55:32,512 root DEBUG BUSKILL_VERSION|{'VERSION': 'v0.7.0', 'GITHUB_REF': 'refs/heads/v0.7.0', 'GITHUB_SHA': '4139a515ea941dba3fffe5714226b135569f46e2', 'SOURCE_DATE_EPOCH': '1687039680'}|
12:55:32,512 root DEBUG os.environ|environ({'USER': 'dh', 'COMMAND_MODE': 'unix2003', '__CFBundleIdentifier': 'buskill-v0.7.0', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin:/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app', 'LOGNAME': 'dh', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.HjiPsXX67p/Listeners', 'HOME': '/Users/dh', 'SHELL': '/bin/zsh', 'TMPDIR': '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'XPC_SERVICE_NAME': '0', 'XPC_FLAGS': '0x0', 'KIVY_DATA_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/data', 'KIVY_MODULES_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/modules', 'GST_REGISTRY_FORK': 'no', 'GST_PLUGIN_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app/Contents/MacOS/gst-plugins', 'GST_REGISTRY': '/Applications/buskill-v0.7.0.app/Contents/MacOS/registry.bin', 'GST_PLUGIN_SYSTEM_PATH': '', 'DYLD_FALLBACK_LIBRARY_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS', 'KIVY_HOME': '/Applications/.buskill'})|
12:55:32,512 root DEBUG os.environ|environ({'USER': 'dh', 'COMMAND_MODE': 'unix2003', '__CFBundleIdentifier': 'buskill-v0.7.0', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin:/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app', 'LOGNAME': 'dh', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.HjiPsXX67p/Listeners', 'HOME': '/Users/dh', 'SHELL': '/bin/zsh', 'TMPDIR': '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'XPC_SERVICE_NAME': '0', 'XPC_FLAGS': '0x0', 'KIVY_DATA_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/data', 'KIVY_MODULES_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/modules', 'GST_REGISTRY_FORK': 'no', 'GST_PLUGIN_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app/Contents/MacOS/gst-plugins', 'GST_REGISTRY': '/Applications/buskill-v0.7.0.app/Contents/MacOS/registry.bin', 'GST_PLUGIN_SYSTEM_PATH': '', 'DYLD_FALLBACK_LIBRARY_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS', 'KIVY_HOME': '/Applications/.buskill'})|
12:55:32,512 root DEBUG sys.argv|['/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill', '--multiprocessing-fork', 'tracker_fd=24', 'pipe_handle=30']|
12:55:32,512 root DEBUG sys.argv|['/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill', '-B', '-S', '-E', '-s', '-c', 'from multiprocessing.semaphore_tracker import main;main(23)']|
12:55:32,512 root DEBUG sys.builtin_modules_names|('_abc', '_ast', '_codecs', '_collections', '_functools', '_imp', '_io', '_locale', '_operator', '_signal', '_sre', '_stat', '_string', '_symtable', '_thread', '_tracemalloc', '_warnings', '_weakref', 'atexit', 'builtins', 'errno', 'faulthandler', 'gc', 'itertools', 'marshal', 'posix', 'pwd', 'sys', 'time', 'xxsubtype', 'zipimport')|
12:55:32,512 root DEBUG sys.builtin_modules_names|('_abc', '_ast', '_codecs', '_collections', '_functools', '_imp', '_io', '_locale', '_operator', '_signal', '_sre', '_stat', '_string', '_symtable', '_thread', '_tracemalloc', '_warnings', '_weakref', 'atexit', 'builtins', 'errno', 'faulthandler', 'gc', 'itertools', 'marshal', 'posix', 'pwd', 'sys', 'time', 'xxsubtype', 'zipimport')|
12:55:32,512 root DEBUG sys.executable|/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill|
12:55:32,513 root DEBUG sys.executable|/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill|
12:55:32,513 root DEBUG sys.path|['/Applications/buskill-v0.7.0.app/Contents/MacOS/base_library.zip', '/Applications/buskill-v0.7.0.app/Contents/MacOS/lib-dynload', '/Applications/buskill-v0.7.0.app/Contents/MacOS']|
12:55:32,513 root DEBUG sys.path|['/Applications/buskill-v0.7.0.app/Contents/MacOS/base_library.zip', '/Applications/buskill-v0.7.0.app/Contents/MacOS/lib-dynload', '/Applications/buskill-v0.7.0.app/Contents/MacOS']|
12:55:32,513 root DEBUG sys.prefix|/Applications/buskill-v0.7.0.app/Contents/MacOS|
12:55:32,513 root DEBUG sys.prefix|/Applications/buskill-v0.7.0.app/Contents/MacOS|
12:55:32,513 root DEBUG sys.version|3.7.8 (default, Jul 4 2020, 10:17:17)
[Clang 11.0.3 (clang-1103.0.32.62)]|
12:55:32,513 root DEBUG sys.version|3.7.8 (default, Jul 4 2020, 10:17:17)
[Clang 11.0.3 (clang-1103.0.32.62)]|
12:55:32,513 root DEBUG sys.api_version|1013|
12:55:32,513 root DEBUG sys.api_version|1013|
12:55:32,513 root DEBUG sys.version_info|sys.version_info(major=3, minor=7, micro=8, releaselevel='final', serial=0)|
12:55:32,513 root DEBUG sys.version_info|sys.version_info(major=3, minor=7, micro=8, releaselevel='final', serial=0)|
12:55:32,513 root DEBUG name|main|
12:55:32,513 root DEBUG name|main|
12:55:32,513 root DEBUG sys.platform|darwin|
12:55:32,513 root DEBUG sys.platform|darwin|
12:55:32,530 root DEBUG platform.platform()|Darwin-23.2.0-x86_64-i386-64bit|
12:55:32,530 root DEBUG platform.platform()|Darwin-23.2.0-x86_64-i386-64bit|
12:55:32,531 root DEBUG platform.system()|Darwin|
12:55:32,531 root DEBUG platform.system()|Darwin|
12:55:32,531 root DEBUG platform.release()|23.2.0|
12:55:32,531 root DEBUG platform.release()|23.2.0|
12:55:32,531 root DEBUG platform.version()|Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.32/RELEASE_ARM64_T8103|
12:55:32,531 root DEBUG platform.version()|Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.3
2/RELEASE_ARM64_T8103|
12:55:32,531 root DEBUG platform.machine()|x86_64|
12:55:32,531 root DEBUG platform.machine()|x86_64|
12:55:32,531 root DEBUG platform.uname()|uname_result(system='Darwin', node='Ss-MacBook-Air.local', release='23.2.0', version='Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.32/RELEASE_ARM64_T8103', machine='x86_64', processor='i386')|
12:55:32,531 root DEBUG platform.uname()|uname_result(system='Darwin', node='Ss-MacBook-Air.local', release='23.2.0', version='Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.3
2/RELEASE_ARM64_T8103', machine='x86_64', processor='i386')|
12:55:32,531 root DEBUG platform.mac_ver()|('10.16', ('', '', ''), 'x86_64')|
12:55:32,531 root DEBUG platform.mac_ver()|('10.16', ('', '', ''), 'x86_64')|
12:55:32,553 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
12:55:32,554 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10ab0c150>|
12:55:32,554 packages.buskill DEBUG device:|Bus 000 Device 005: ID 2109:8817|
12:55:32,554 packages.buskill DEBUG event:|1|
12:55:32,554 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
12:55:32,554 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
12:55:32,554 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
12:55:32,554 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10ab0c150>|
12:55:32,554 packages.buskill DEBUG device:|Bus 000 Device 004: ID 0bda:8153|
12:55:32,554 packages.buskill DEBUG event:|1|
12:55:32,554 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
12:55:32,554 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
12:55:32,554 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
12:55:32,554 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10ab0c150>|
12:55:32,554 packages.buskill DEBUG device:|Bus 000 Device 003: ID 21c4:8005|
12:55:32,554 packages.buskill DEBUG event:|1|
12:55:32,554 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
12:55:32,554 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
12:55:32,554 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
12:55:32,554 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10ab0c150>|
12:55:32,554 packages.buskill DEBUG device:|Bus 000 Device 002: ID 2109:0817|
12:55:32,554 packages.buskill DEBUG event:|1|
12:55:32,554 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
12:55:32,554 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
12:55:32,555 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
12:55:32,555 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10ab0c150>|
12:55:32,555 packages.buskill DEBUG device:|Bus 000 Device 001: ID 2109:2817|
12:55:32,555 packages.buskill DEBUG event:|1|
12:55:32,555 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
12:55:32,555 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
12:55:37,754 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
12:55:37,754 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10ab0c150>|
12:55:37,755 packages.buskill DEBUG device:|Bus 000 Device 003: ID 21c4:8005|
12:55:37,755 packages.buskill DEBUG event:|2|
12:55:37,756 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
12:55:37,757 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
12:55:37,757 packages.buskill INFO INFO: Detected USB removal event
12:55:37,757 packages.buskill DEBUG calling <bound method BusKill.triggerMac of <packages.buskill.BusKill object at 0x10adfa190>>
12:55:37,773 packages.buskill ERROR DEBUG: Queue message from child usb_handler (trigger)
12:55:37,774 packages.buskill DEBUG DEBUG: BusKill soft-shutdown trigger executing now
12:55:37,774 packages.buskill DEBUG DEBUG: Attempting to send 'soft-shutdown' command to root child
12:55:37,779 packages.buskill ERROR ERROR: Failed to send 'soft-shutdown' command to root child
'NoneType' object is not subscriptable
12:55:42,684 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
12:55:42,685 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10ab0c150>|
12:55:42,686 packages.buskill DEBUG device:|Bus 000 Device 003: ID 21c4:8005|
12:55:42,686 packages.buskill DEBUG event:|1|
12:55:42,686 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
12:55:42,686 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
12:55:46,326 buskill_gui DEBUG DEBUG: User switched to 'DebugLog' screen

@maltfield
Copy link
Member

Thanks for the report.

Please do not execute BuKill as root. It's designed to spawn a very small child program as root to execute the shutdown. More info here

@maltfield
Copy link
Member

maltfield commented Feb 18, 2024

The relevant error from you log is here

12:55:30,482 packages.buskill DEBUG DEBUG: Attempting to set 'trigger' set to 'soft-shutdown'
12:55:30,482 packages.buskill DEBUG DEBUG: Called spawn_root_child()
12:55:30,482 packages.buskill DEBUG DEBUG: No root_child detected. Attempting to spawn one.
12:55:30,482 packages.buskill INFO INFO: You have requested BusKill to do something that requires elevated privliges on your platform. If you'd like to proceed, please authorize BusKill to preform actions as Administrator. Your system may prompt you for your password to proceed.
12:55:30,482 packages.buskill DEBUG DEBUG: root_child_path:|/Applications/buskill-v0.7.0.app/Contents/MacOS/root_child_mac|
12:55:30,483 packages.buskill ERROR ERROR: root_child is not owned by gid=0 nor your group. Refusing to spawn script as root!

This is a security protection. BusKill refuses to try to execute a file as root if it's not owned by root, because then a malicious software with non-root privileges could edit the file and then wait for it to be executed as root to escalate their privileges to become root.

# To spawn a child process as root in MacOS, we use
# AuthorizationExecuteWithPrivileges(), which triggers the OS to
# display an auth challenge in the GUI for the user. See also
# * https://stackoverflow.com/a/74001980/1174102
# * https://stackoverflow.com/a/74083291/1174102
# * https://github.com/BusKill/buskill-app/issues/14
# was BusKill called as a binary or a script?
if self.EXECUTED_AS_SCRIPT == False:
# this execution was a binary
# let's call the root child binary
root_child_path = self.SRC_DIR +os.sep+ 'root_child_mac'
# and we'll be calling the binary directly
exe = [root_child_path, self.LOG_FILE_PATH]
else:
# this execution was a script; let's call the root child script
root_child_path = self.SRC_DIR +os.sep+ 'packages' +os.sep+ 'buskill' +os.sep+ 'root_child_mac.py'
# and we'll pass the script as an argument to the python
# interpreter
exe = [sys.executable, root_child_path, self.LOG_FILE_PATH]
msg = "DEBUG: root_child_path:|" +str(root_child_path)+ "|"
print( msg ); logger.debug( msg )
# SANITY CHECKS
mode = oct(os.stat(root_child_path).st_mode)[-4:]
owner = os.stat(root_child_path).st_uid
group = os.stat(root_child_path).st_gid
# verify the mode of the file is exactly 0500 (octal)
if mode != '0500':
msg = 'ERROR: Permissions on root_child are not 0500. Refusing to spawn script as root!'
print( msg ); logger.error( msg )
return False
# unfortunaetly we can't package a .dmg with a file owned by root, so on
# first run, we expect that the root child script will be owned by the
# user that executed the BusKill app
# https://github.com/BusKill/buskill-app/issues/14#issuecomment-1279975783
# verify the file is owned by user = root (or current user)
if owner != 0 and owner != os.getuid():
msg = 'ERROR: root_child is not owned by root nor your user. Refusing to spawn script as root!'
print( msg ); logger.error( msg )
return False
# verify the file is owned by group = root (or current group)
if group != 0 and group != os.getgid():
msg = 'ERROR: root_child is not owned by gid=0 nor your group. Refusing to spawn script as root!'
print( msg ); logger.error( msg )
return False

@samxplogs Can you please:

  1. Tell how you installed the BusKill software and
  2. Execute ls -lah /Applications/buskill-v0.7.0.app/Contents/MacOS/ and paste the output here

@maltfield
Copy link
Member

maltfield commented Feb 18, 2024

TODO:

  1. Add better logging that outputs the owner, group, and mode of the root_child script
  2. Add better logging that outputs the owner & group of the current user
  3. Update root_child to actually harden/change owner, group, and mode of the root_child script on first execution
  4. GUI error message if it refuses to execute root child due to unexpected permissions (link to docs with a longer description of the issue). Eg WARNING: Unexpected permissions. Refusing to spawn root child

@maltfield maltfield self-assigned this Feb 21, 2024
@samxplogs
Copy link
Author

Hello Michael,

I have downloaded the dmg file buskill-mac-v0.7.0-x86_64.dmg
over here https://github.com/BusKill/buskill-app/releases/tag/v0.7.0
Then I mounted the file by double clicking. Finally I dragged and dropped the buskill-v0.7.0 binary to the Applications folder.

ls -lah /Applications/buskill-v0.7.0.app/Contents/MacOS/
total 29512
drwxr-xr-x@ 46 dh admin 1.4K Jun 18 2023 .
drwxr-xr-x@ 7 dh admin 224B Jun 18 2023 ..
-rwxr-xr-x@ 1 dh admin 271K Jun 18 2023 FLAC
-rwxr-xr-x@ 1 dh admin 727K Jun 18 2023 FreeType
lrwxr-xr-x 1 dh admin 17B Jun 18 2023 KEYS -> ../Resources/KEYS
-rwxr-xr-x@ 1 dh admin 47K Jun 18 2023 Ogg
-rwxr-xr-x@ 1 dh admin 2.3M Jun 18 2023 Python
-rwxr-xr-x@ 1 dh admin 1.3M Jun 18 2023 SDL2
-rwxr-xr-x@ 1 dh admin 136K Jun 18 2023 SDL2_image
-rwxr-xr-x@ 1 dh admin 133K Jun 18 2023 SDL2_mixer
-rwxr-xr-x@ 1 dh admin 48K Jun 18 2023 SDL2_ttf
-rwxr-xr-x@ 1 dh admin 931K Jun 18 2023 Vorbis
lrwxr-xr-x 1 dh admin 24B Jun 18 2023 pycache -> ../Resources/pycache
lrwxr-xr-x 1 dh admin 29B Jun 18 2023 base_library.zip -> ../Resources/base_library.zip
-rwxr-xr-x@ 1 dh admin 4.2M Jun 18 2023 buskill
lrwxr-xr-x 1 dh admin 33B Jun 18 2023 buskill-icon-150.png -> ../Resources/buskill-icon-150.png
lrwxr-xr-x 1 dh admin 30B Jun 18 2023 buskill-icon.icns -> ../Resources/buskill-icon.icns
lrwxr-xr-x 1 dh admin 23B Jun 18 2023 buskill.kv -> ../Resources/buskill.kv
lrwxr-xr-x 1 dh admin 27B Jun 18 2023 buskill_cli.py -> ../Resources/buskill_cli.py
lrwxr-xr-x 1 dh admin 27B Jun 18 2023 buskill_gui.py -> ../Resources/buskill_gui.py
lrwxr-xr-x 1 dh admin 31B Jun 18 2023 buskill_version.py -> ../Resources/buskill_version.py
lrwxr-xr-x 1 dh admin 20B Jun 18 2023 certifi -> ../Resources/certifi
lrwxr-xr-x 1 dh admin 21B Jun 18 2023 docutils -> ../Resources/docutils
lrwxr-xr-x 1 dh admin 18B Jun 18 2023 fonts -> ../Resources/fonts
lrwxr-xr-x 1 dh admin 16B Jun 18 2023 gpg -> ../Resources/gpg
lrwxr-xr-x 1 dh admin 19B Jun 18 2023 images -> ../Resources/images
drwxr-xr-x@ 9 dh admin 288B Jun 18 2023 kivy
lrwxr-xr-x 1 dh admin 25B Jun 18 2023 kivy_install -> ../Resources/kivy_install
drwxr-xr-x@ 51 dh admin 1.6K Jun 18 2023 lib-dynload
lrwxr-xr-x 1 dh admin 30B Jun 18 2023 libassuan.0.dylib -> ../Resources/libassuan.0.dylib
-rwxr-xr-x@ 1 dh admin 2.3M Jun 18 2023 libcrypto.1.1.dylib
lrwxr-xr-x 1 dh admin 31B Jun 18 2023 libgcrypt.20.dylib -> ../Resources/libgcrypt.20.dylib
lrwxr-xr-x 1 dh admin 33B Jun 18 2023 libgpg-error.0.dylib -> ../Resources/libgpg-error.0.dylib
lrwxr-xr-x 1 dh admin 28B Jun 18 2023 libintl.8.dylib -> ../Resources/libintl.8.dylib
lrwxr-xr-x 1 dh admin 22B Jun 18 2023 libintl.a -> ../Resources/libintl.a
lrwxr-xr-x 1 dh admin 26B Jun 18 2023 libintl.dylib -> ../Resources/libintl.dylib
-rwxr-xr-x@ 1 dh admin 197K Jun 18 2023 liblzma.5.dylib
lrwxr-xr-x 1 dh admin 28B Jun 18 2023 libnpth.0.dylib -> ../Resources/libnpth.0.dylib
-rwxr-xr-x@ 1 dh admin 288K Jun 18 2023 libreadline.8.dylib
-rwxr-xr-x@ 1 dh admin 510K Jun 18 2023 libssl.1.1.dylib
lrwxr-xr-x 1 dh admin 29B Jun 18 2023 libusb-1.0.dylib -> ../Resources/libusb-1.0.dylib
lrwxr-xr-x 1 dh admin 20B Jun 18 2023 main.py -> ../Resources/main.py
-rwxr-xr-x@ 1 dh admin 226K Jun 18 2023 modplug
-rwxr-xr-x@ 1 dh admin 271K Jun 18 2023 mpg123
lrwxr-xr-x 1 dh admin 21B Jun 18 2023 packages -> ../Resources/packages
-r-x------@ 1 dh admin 609K Jun 18 2023 root_child_mac

@maltfield
Copy link
Member

maltfield commented Feb 22, 2024

@samxplogs can you also please provide the numerical ids with

ls -lahn /Applications/buskill-v0.7.0.app/Contents/MacOS/

@samxplogs
Copy link
Author

Hey @maltfield, here you go

ls -lahn /Applications/buskill-v0.7.0.app/Contents/MacOS/
total 29512
drwxr-xr-x@ 46 501 80 1.4K Jun 18 2023 .
drwxr-xr-x@ 7 501 80 224B Jun 18 2023 ..
-rwxr-xr-x@ 1 501 80 271K Jun 18 2023 FLAC
-rwxr-xr-x@ 1 501 80 727K Jun 18 2023 FreeType
lrwxr-xr-x 1 501 80 17B Jun 18 2023 KEYS -> ../Resources/KEYS
-rwxr-xr-x@ 1 501 80 47K Jun 18 2023 Ogg
-rwxr-xr-x@ 1 501 80 2.3M Jun 18 2023 Python
-rwxr-xr-x@ 1 501 80 1.3M Jun 18 2023 SDL2
-rwxr-xr-x@ 1 501 80 136K Jun 18 2023 SDL2_image
-rwxr-xr-x@ 1 501 80 133K Jun 18 2023 SDL2_mixer
-rwxr-xr-x@ 1 501 80 48K Jun 18 2023 SDL2_ttf
-rwxr-xr-x@ 1 501 80 931K Jun 18 2023 Vorbis
lrwxr-xr-x 1 501 80 24B Jun 18 2023 pycache -> ../Resources/pycache
lrwxr-xr-x 1 501 80 29B Jun 18 2023 base_library.zip -> ../Resources/base_library.zip
-rwxr-xr-x@ 1 501 80 4.2M Jun 18 2023 buskill
lrwxr-xr-x 1 501 80 33B Jun 18 2023 buskill-icon-150.png -> ../Resources/buskill-icon-150.png
lrwxr-xr-x 1 501 80 30B Jun 18 2023 buskill-icon.icns -> ../Resources/buskill-icon.icns
lrwxr-xr-x 1 501 80 23B Jun 18 2023 buskill.kv -> ../Resources/buskill.kv
lrwxr-xr-x 1 501 80 27B Jun 18 2023 buskill_cli.py -> ../Resources/buskill_cli.py
lrwxr-xr-x 1 501 80 27B Jun 18 2023 buskill_gui.py -> ../Resources/buskill_gui.py
lrwxr-xr-x 1 501 80 31B Jun 18 2023 buskill_version.py -> ../Resources/buskill_version.py
lrwxr-xr-x 1 501 80 20B Jun 18 2023 certifi -> ../Resources/certifi
lrwxr-xr-x 1 501 80 21B Jun 18 2023 docutils -> ../Resources/docutils
lrwxr-xr-x 1 501 80 18B Jun 18 2023 fonts -> ../Resources/fonts
lrwxr-xr-x 1 501 80 16B Jun 18 2023 gpg -> ../Resources/gpg
lrwxr-xr-x 1 501 80 19B Jun 18 2023 images -> ../Resources/images
drwxr-xr-x@ 9 501 80 288B Jun 18 2023 kivy
lrwxr-xr-x 1 501 80 25B Jun 18 2023 kivy_install -> ../Resources/kivy_install
drwxr-xr-x@ 51 501 80 1.6K Jun 18 2023 lib-dynload
lrwxr-xr-x 1 501 80 30B Jun 18 2023 libassuan.0.dylib -> ../Resources/libassuan.0.dylib
-rwxr-xr-x@ 1 501 80 2.3M Jun 18 2023 libcrypto.1.1.dylib
lrwxr-xr-x 1 501 80 31B Jun 18 2023 libgcrypt.20.dylib -> ../Resources/libgcrypt.20.dylib
lrwxr-xr-x 1 501 80 33B Jun 18 2023 libgpg-error.0.dylib -> ../Resources/libgpg-error.0.dylib
lrwxr-xr-x 1 501 80 28B Jun 18 2023 libintl.8.dylib -> ../Resources/libintl.8.dylib
lrwxr-xr-x 1 501 80 22B Jun 18 2023 libintl.a -> ../Resources/libintl.a
lrwxr-xr-x 1 501 80 26B Jun 18 2023 libintl.dylib -> ../Resources/libintl.dylib
-rwxr-xr-x@ 1 501 80 197K Jun 18 2023 liblzma.5.dylib
lrwxr-xr-x 1 501 80 28B Jun 18 2023 libnpth.0.dylib -> ../Resources/libnpth.0.dylib
-rwxr-xr-x@ 1 501 80 288K Jun 18 2023 libreadline.8.dylib
-rwxr-xr-x@ 1 501 80 510K Jun 18 2023 libssl.1.1.dylib
lrwxr-xr-x 1 501 80 29B Jun 18 2023 libusb-1.0.dylib -> ../Resources/libusb-1.0.dylib
lrwxr-xr-x 1 501 80 20B Jun 18 2023 main.py -> ../Resources/main.py
-rwxr-xr-x@ 1 501 80 226K Jun 18 2023 modplug
-rwxr-xr-x@ 1 501 80 271K Jun 18 2023 mpg123
lrwxr-xr-x 1 501 80 21B Jun 18 2023 packages -> ../Resources/packages
-r-x------@ 1 501 80 609K Jun 18 2023 root_child_mac

@samxplogs
Copy link
Author

In the meantime, I tried

sudo chown root:wheel [buskill-v0.7.0.app](http://buskill-v0.7.0.app)

I browsed online and I have found that root:wheel: Specifies the new owner (root) and group (wheel). On macOS, wheel is a traditional group name for the system administrator group, similar to root.

However it is still not working at that time.

23:11:56,959 root INFO ===============================================================================
23:11:56,960 root INFO INFO: Writing to log file '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/buskill.log'
23:11:56,960 root DEBUG BUSKILL_VERSION|{'VERSION': 'v0.7.0', 'GITHUB_REF': 'refs/heads/v0.7.0', 'GITHUB_SHA': '4139a515ea941dba3fffe5714226b135569f46e2', 'SOURCE_DATE_EPOCH': '1687039680'}|
23:11:56,960 root DEBUG os.environ|environ({'USER': 'dh', 'COMMAND_MODE': 'unix2003', '__CFBundleIdentifier': 'buskill-v0.7.0', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'LOGNAME': 'dh', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.pCgGfrvZHC/Listeners', 'HOME': '/Users/dh', 'SHELL': '/bin/zsh', 'TMPDIR': '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'XPC_SERVICE_NAME': 'application.buskill-v0.7.0.18450406.18450465', 'XPC_FLAGS': '0x0', 'KIVY_DATA_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/data', 'KIVY_MODULES_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/modules', 'GST_REGISTRY_FORK': 'no', 'GST_PLUGIN_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app/Contents/MacOS/gst-plugins', 'GST_REGISTRY': '/Applications/buskill-v0.7.0.app/Contents/MacOS/registry.bin', 'GST_PLUGIN_SYSTEM_PATH': ''})|
23:11:56,960 root DEBUG sys.argv|['/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill']|
23:11:56,960 root DEBUG sys.builtin_modules_names|('_abc', '_ast', '_codecs', '_collections', '_functools', '_imp', '_io', '_locale', '_operator', '_signal', '_sre', '_stat', '_string', '_symtable', '_thread', '_tracemalloc', '_warnings', '_weakref', 'atexit', 'builtins', 'errno', 'faulthandler', 'gc', 'itertools', 'marshal', 'posix', 'pwd', 'sys', 'time', 'xxsubtype', 'zipimport')|
23:11:56,960 root DEBUG sys.executable|/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill|
23:11:56,960 root DEBUG sys.path|['/Applications/buskill-v0.7.0.app/Contents/MacOS/base_library.zip', '/Applications/buskill-v0.7.0.app/Contents/MacOS/lib-dynload', '/Applications/buskill-v0.7.0.app/Contents/MacOS']|
23:11:56,960 root DEBUG sys.prefix|/Applications/buskill-v0.7.0.app/Contents/MacOS|
23:11:56,960 root DEBUG sys.version|3.7.8 (default, Jul 4 2020, 10:17:17)
[Clang 11.0.3 (clang-1103.0.32.62)]|
23:11:56,960 root DEBUG sys.api_version|1013|
23:11:56,960 root DEBUG sys.version_info|sys.version_info(major=3, minor=7, micro=8, releaselevel='final', serial=0)|
23:11:56,960 root DEBUG name|main|
23:11:56,960 root DEBUG sys.platform|darwin|
23:11:56,990 root DEBUG platform.platform()|Darwin-23.2.0-x86_64-i386-64bit|
23:11:56,990 root DEBUG platform.system()|Darwin|
23:11:56,990 root DEBUG platform.release()|23.2.0|
23:11:56,990 root DEBUG platform.version()|Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.32/RELEASE_ARM64_T8103|
23:11:56,990 root DEBUG platform.machine()|x86_64|
23:11:56,990 root DEBUG platform.uname()|uname_result(system='Darwin', node='Ss-MacBook-Air.local', release='23.2.0', version='Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.3
2/RELEASE_ARM64_T8103', machine='x86_64', processor='i386')|
23:11:56,991 root DEBUG platform.mac_ver()|('10.16', ('', '', ''), 'x86_64')|
23:11:56,991 root INFO buskill version {'VERSION': 'v0.7.0', 'GITHUB_REF': 'refs/heads/v0.7.0', 'GITHUB_SHA': '4139a515ea941dba3fffe5714226b135569f46e2', 'SOURCE_DATE_EPOCH': '1687039680'}
23:11:56,992 packages.buskill DEBUG DEBUG: EXECUTED_AS_SCRIPT:|False|
DEBUG: EXE_PATH:|/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill|
DEBUG: EXE_DIR:|/Applications/buskill-v0.7.0.app/Contents/MacOS|
DEBUG: EXE_FILE:|buskill|
DEBUG: APP_DIR:|/Applications/buskill-v0.7.0.app|
DEBUG: APPS_DIR:|/Applications|
DEBUG: SRC_DIR:|/Applications/buskill-v0.7.0.app/Contents/MacOS|
DEBUG: os.environ['PATH']:|/usr/bin:/bin:/usr/sbin:/sbin:/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app|

23:11:56,992 packages.buskill INFO INFO: using DATA_DIR:|/Applications/.buskill|
23:11:56,993 packages.buskill DEBUG DEBUG: CONF_FILE:|/Applications/.buskill/config.ini|

23:11:57,8 kivy INFO [Logger ] Record log in /Applications/.buskill/logs/kivy_24-02-25_0.txt
23:11:57,8 kivy INFO [Kivy ] v1.11.1
23:11:57,8 kivy INFO [Kivy ] Installed at "/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy/init.pyc"
23:11:57,8 kivy INFO [Python ] v3.7.8 (default, Jul 4 2020, 10:17:17)
[Clang 11.0.3 (clang-1103.0.32.62)]
23:11:57,8 kivy INFO [Python ] Interpreter at "/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill"
23:11:57,136 kivy INFO [Factory ] 184 symbols loaded
23:11:57,701 kivy INFO [Image ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
23:11:58,37 kivy INFO [Window ] Provider: sdl2
23:11:58,865 kivy INFO [GL ] Using the "OpenGL ES 2" graphics system
23:11:58,866 kivy INFO [GL ] Backend used
23:11:58,867 kivy INFO [GL ] OpenGL version <b'2.1 Metal - 88'>
23:11:58,867 kivy INFO [GL ] OpenGL vendor <b'Apple'>
23:11:58,867 kivy INFO [GL ] OpenGL renderer <b'Apple M1'>
23:11:58,867 kivy INFO [GL ] OpenGL parsed version: 2, 1
23:11:58,867 kivy INFO [GL ] Shading version <b'1.20'>
23:11:58,868 kivy INFO [GL ] Texture max size <16384>
23:11:58,868 kivy INFO [GL ] Texture max units <16>
23:11:58,942 kivy INFO [Window ] auto add sdl2 input provider
23:11:58,981 kivy INFO [Window ] virtual keyboard not allowed, single mode, not docked
23:11:59,35 kivy INFO [Text ] Provider: sdl2
23:11:59,43 kivy INFO [Clipboard ] Provider: sdl2(['clipboard_nspaste'] ignored)
23:11:59,105 kivy INFO [GL ] NPOT texture support is available
23:11:59,139 buskill_gui DEBUG DEBUG: adding screen:||
23:11:59,139 buskill_gui DEBUG DEBUG: User switched to 'MainWindow' screen
23:11:59,139 buskill_gui DEBUG DEBUG: adding screen:||
23:11:59,139 buskill_gui DEBUG DEBUG: adding screen:||
23:11:59,151 kivy INFO [Base ] Start application main loop
23:16:27,844 buskill_gui DEBUG DEBUG: User switched to 'Settings' screen
23:16:30,286 buskill_gui DEBUG DEBUG: User switched to 'MainWindow' screen
23:16:30,287 packages.buskill DEBUG DEBUG: Attempting to set 'trigger' set to 'soft-shutdown'
23:16:30,288 packages.buskill DEBUG DEBUG: Called spawn_root_child()
23:16:30,288 packages.buskill DEBUG DEBUG: No root_child detected. Attempting to spawn one.
23:16:30,288 packages.buskill INFO INFO: You have requested BusKill to do something that requires elevated privliges on your platform. If you'd like to proceed, please authorize BusKill to preform actions as Administrator. Your system may prompt you for your password to proceed.
23:16:30,289 packages.buskill DEBUG DEBUG: root_child_path:|/Applications/buskill-v0.7.0.app/Contents/MacOS/root_child_mac|
23:16:30,289 packages.buskill ERROR ERROR: root_child is not owned by gid=0 nor your group. Refusing to spawn script as root!
23:16:30,289 packages.buskill INFO INFO: BusKill 'trigger' set to 'soft-shutdown'
23:16:31,492 packages.buskill DEBUG DEBUG: attempting to arm BusKill via <bound method BusKill.armNix of <packages.buskill.BusKill object at 0x10ac4a410>>() with the 'soft-shutdown' trigger
23:16:31,591 kivy WARNING stderr: [DEBUG/MainProcess] created semlock with handle 24
23:16:31,602 kivy WARNING stderr: [DEBUG/MainProcess] created semlock with handle 25
23:16:31,603 kivy WARNING stderr: [DEBUG/MainProcess] created semlock with handle 27
23:16:31,603 kivy WARNING stderr: [DEBUG/MainProcess] Queue._after_fork()
23:16:31,606 packages.buskill DEBUG DEBUG:getstate() pre:dict_keys(['CURRENT_PLATFORM', 'KERNEL_VERSION', 'IS_PLATFORM_SUPPORTED', 'OS_NAME_SHORT', 'ERR_PLATFORM_NOT_SUPPORTED', 'ARM_FUNCTION', 'DISARM_FUNCTION', 'TRIGGER_FUNCTION', 'SIMULATE_HOTPLUG_REMOVAL', 'EXECUTED_AS_SCRIPT', 'LOG_FILE_PATH', 'EXE_PATH', 'EXE_DIR', 'EXE_FILE', 'APP_DIR', 'APPS_DIR', 'SRC_DIR', 'DATA_DIR', 'CACHE_DIR', 'CONF_FILE', 'GNUPGHOME', 'UPGRADED_FROM', 'UPGRADED_TO', 'root_child', 'is_armed', 'usb_handler', 'usb_handler_queue', 'upgrade_status_msg', 'upgrade_result', 'trigger', 'SUPPORTED_TRIGGERS', 'trigger_softshutdown_lin_shutdown_path', 'trigger_softshutdown_lin_poweroff_path', 'trigger_softshutdown_lin_systemctl_path', 'url_website', 'url_documentation', 'url_documentation_contribute', 'url_documentation_bug_report', 'url_documentation_gui'])|
23:16:31,606 packages.buskill DEBUG DEBUG:getstate() post:|dict_keys(['CURRENT_PLATFORM', 'KERNEL_VERSION', 'IS_PLATFORM_SUPPORTED', 'OS_NAME_SHORT', 'ERR_PLATFORM_NOT_SUPPORTED', 'ARM_FUNCTION', 'DISARM_FUNCTION', 'TRIGGER_FUNCTION', 'SIMULATE_HOTPLUG_REMOVAL', 'EXECUTED_AS_SCRIPT', 'LOG_FILE_PATH', 'EXE_PATH', 'EXE_DIR', 'EXE_FILE', 'APP_DIR', 'APPS_DIR', 'SRC_DIR', 'DATA_DIR', 'CACHE_DIR', 'CONF_FILE', 'GNUPGHOME', 'UPGRADED_FROM', 'UPGRADED_TO', 'is_armed', 'usb_handler_queue', 'upgrade_status_msg', 'upgrade_result', 'trigger', 'SUPPORTED_TRIGGERS', 'trigger_softshutdown_lin_shutdown_path', 'trigger_softshutdown_lin_poweroff_path', 'trigger_softshutdown_lin_systemctl_path', 'url_website', 'url_documentation', 'url_documentation_contribute', 'url_documentation_bug_report', 'url_documentation_gui'])|
23:16:31,614 packages.buskill INFO INFO: BusKill is armed. Listening for removal event.
INFO: To disarm the CLI, exit with ^C or close this terminal
23:16:32,430 root INFO ===============================================================================
23:16:32,430 root INFO ===============================================================================
23:16:32,430 root INFO INFO: Writing to log file '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/buskill.log'
23:16:32,430 root INFO INFO: Writing to log file '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/buskill.log'
23:16:32,430 root DEBUG BUSKILL_VERSION|{'VERSION': 'v0.7.0', 'GITHUB_REF': 'refs/heads/v0.7.0', 'GITHUB_SHA': '4139a515ea941dba3fffe5714226b135569f46e2', 'SOURCE_DATE_EPOCH': '1687039680'}|
23:16:32,430 root DEBUG BUSKILL_VERSION|{'VERSION': 'v0.7.0', 'GITHUB_REF': 'refs/heads/v0.7.0', 'GITHUB_SHA': '4139a515ea941dba3fffe5714226b135569f46e2', 'SOURCE_DATE_EPOCH': '1687039680'}|
23:16:32,430 root DEBUG os.environ|environ({'USER': 'dh', 'COMMAND_MODE': 'unix2003', '__CFBundleIdentifier': 'buskill-v0.7.0', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin:/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app', 'LOGNAME': 'dh', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.pCgGfrvZHC/Listeners', 'HOME': '/Users/dh', 'SHELL': '/bin/zsh', 'TMPDIR': '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'XPC_SERVICE_NAME': '0', 'XPC_FLAGS': '0x0', 'KIVY_DATA_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/data', 'KIVY_MODULES_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/modules', 'GST_REGISTRY_FORK': 'no', 'GST_PLUGIN_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app/Contents/MacOS/gst-plugins', 'GST_REGISTRY': '/Applications/buskill-v0.7.0.app/Contents/MacOS/registry.bin', 'GST_PLUGIN_SYSTEM_PATH': '', 'DYLD_FALLBACK_LIBRARY_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS', 'KIVY_HOME': '/Applications/.buskill'})|
23:16:32,430 root DEBUG os.environ|environ({'USER': 'dh', 'COMMAND_MODE': 'unix2003', '__CFBundleIdentifier': 'buskill-v0.7.0', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin:/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app', 'LOGNAME': 'dh', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.pCgGfrvZHC/Listeners', 'HOME': '/Users/dh', 'SHELL': '/bin/zsh', 'TMPDIR': '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'XPC_SERVICE_NAME': '0', 'XPC_FLAGS': '0x0', 'KIVY_DATA_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/data', 'KIVY_MODULES_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/modules', 'GST_REGISTRY_FORK': 'no', 'GST_PLUGIN_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app/Contents/MacOS/gst-plugins', 'GST_REGISTRY': '/Applications/buskill-v0.7.0.app/Contents/MacOS/registry.bin', 'GST_PLUGIN_SYSTEM_PATH': '', 'DYLD_FALLBACK_LIBRARY_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS', 'KIVY_HOME': '/Applications/.buskill'})|
23:16:32,430 root DEBUG sys.argv|['/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill', '--multiprocessing-fork', 'tracker_fd=26', 'pipe_handle=32']|
23:16:32,430 root DEBUG sys.argv|['/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill', '-B', '-S', '-E', '-s', '-c', 'from multiprocessing.semaphore_tracker import main;main(25)']|
23:16:32,430 root DEBUG sys.builtin_modules_names|('_abc', '_ast', '_codecs', '_collections', '_functools', '_imp', '_io', '_locale', '_operator', '_signal', '_sre', '_stat', '_string', '_symtable', '_thread', '_tracemalloc', '_warnings', '_weakref', 'atexit', 'builtins', 'errno', 'faulthandler', 'gc', 'itertools', 'marshal', 'posix', 'pwd', 'sys', 'time', 'xxsubtype', 'zipimport')|
23:16:32,430 root DEBUG sys.builtin_modules_names|('_abc', '_ast', '_codecs', '_collections', '_functools', '_imp', '_io', '_locale', '_operator', '_signal', '_sre', '_stat', '_string', '_symtable', '_thread', '_tracemalloc', '_warnings', '_weakref', 'atexit', 'builtins', 'errno', 'faulthandler', 'gc', 'itertools', 'marshal', 'posix', 'pwd', 'sys', 'time', 'xxsubtype', 'zipimport')|
23:16:32,430 root DEBUG sys.executable|/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill|
23:16:32,430 root DEBUG sys.executable|/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill|
23:16:32,430 root DEBUG sys.path|['/Applications/buskill-v0.7.0.app/Contents/MacOS/base_library.zip', '/Applications/buskill-v0.7.0.app/Contents/MacOS/lib-dynload', '/Applications/buskill-v0.7.0.app/Contents/MacOS']|
23:16:32,430 root DEBUG sys.path|['/Applications/buskill-v0.7.0.app/Contents/MacOS/base_library.zip', '/Applications/buskill-v0.7.0.app/Contents/MacOS/lib-dynload', '/Applications/buskill-v0.7.0.app/Contents/MacOS']|
23:16:32,430 root DEBUG sys.prefix|/Applications/buskill-v0.7.0.app/Contents/MacOS|
23:16:32,430 root DEBUG sys.prefix|/Applications/buskill-v0.7.0.app/Contents/MacOS|
23:16:32,430 root DEBUG sys.version|3.7.8 (default, Jul 4 2020, 10:17:17)
[Clang 11.0.3 (clang-1103.0.32.62)]|
23:16:32,430 root DEBUG sys.version|3.7.8 (default, Jul 4 2020, 10:17:17)
[Clang 11.0.3 (clang-1103.0.32.62)]|
23:16:32,430 root DEBUG sys.api_version|1013|
23:16:32,430 root DEBUG sys.api_version|1013|
23:16:32,430 root DEBUG sys.version_info|sys.version_info(major=3, minor=7, micro=8, releaselevel='final', serial=0)|
23:16:32,430 root DEBUG sys.version_info|sys.version_info(major=3, minor=7, micro=8, releaselevel='final', serial=0)|
23:16:32,430 root DEBUG name|main|
23:16:32,430 root DEBUG name|main|
23:16:32,430 root DEBUG sys.platform|darwin|
23:16:32,430 root DEBUG sys.platform|darwin|
23:16:32,450 root DEBUG platform.platform()|Darwin-23.2.0-x86_64-i386-64bit|
23:16:32,450 root DEBUG platform.platform()|Darwin-23.2.0-x86_64-i386-64bit|
23:16:32,450 root DEBUG platform.system()|Darwin|
23:16:32,450 root DEBUG platform.release()|23.2.0|
23:16:32,450 root DEBUG platform.system()|Darwin|
23:16:32,450 root DEBUG platform.version()|Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.32/RELEASE_ARM64_T8103|
23:16:32,450 root DEBUG platform.release()|23.2.0|
23:16:32,450 root DEBUG platform.machine()|x86_64|
23:16:32,450 root DEBUG platform.version()|Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.3
2/RELEASE_ARM64_T8103|
23:16:32,450 root DEBUG platform.machine()|x86_64|
23:16:32,450 root DEBUG platform.uname()|uname_result(system='Darwin', node='Ss-MacBook-Air.local', release='23.2.0', version='Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.32/RELEASE_ARM64_T8103', machine='x86_64', processor='i386')|
23:16:32,450 root DEBUG platform.uname()|uname_result(system='Darwin', node='Ss-MacBook-Air.local', release='23.2.0', version='Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.3
2/RELEASE_ARM64_T8103', machine='x86_64', processor='i386')|
23:16:32,451 root DEBUG platform.mac_ver()|('10.16', ('', '', ''), 'x86_64')|
23:16:32,451 root DEBUG platform.mac_ver()|('10.16', ('', '', ''), 'x86_64')|
23:16:32,508 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:16:32,508 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:16:32,508 packages.buskill DEBUG device:|Bus 001 Device 005: ID 21c4:8005|
23:16:32,508 packages.buskill DEBUG event:|1|
23:16:32,509 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:16:32,509 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:16:32,509 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:16:32,509 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:16:32,509 packages.buskill DEBUG device:|Bus 001 Device 004: ID 2109:8817|
23:16:32,509 packages.buskill DEBUG event:|1|
23:16:32,509 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:16:32,509 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:16:32,509 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:16:32,509 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:16:32,509 packages.buskill DEBUG device:|Bus 001 Device 003: ID 0bda:8153|
23:16:32,509 packages.buskill DEBUG event:|1|
23:16:32,509 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:16:32,509 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:16:32,509 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:16:32,509 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:16:32,509 packages.buskill DEBUG device:|Bus 001 Device 002: ID 2109:0817|
23:16:32,509 packages.buskill DEBUG event:|1|
23:16:32,509 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:16:32,509 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:16:32,509 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:16:32,509 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:16:32,509 packages.buskill DEBUG device:|Bus 001 Device 001: ID 2109:2817|
23:16:32,509 packages.buskill DEBUG event:|1|
23:16:32,509 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:16:32,509 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:16:32,509 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:16:32,509 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:16:32,509 packages.buskill DEBUG device:|Bus 000 Device 005: ID 1d50:6124|
23:16:32,509 packages.buskill DEBUG event:|1|
23:16:32,509 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:16:32,509 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:16:32,509 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:16:32,509 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:16:32,509 packages.buskill DEBUG device:|Bus 000 Device 004: ID 045e:082a|
23:16:32,510 packages.buskill DEBUG event:|1|
23:16:32,510 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:16:32,510 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:16:32,510 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:16:32,510 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:16:32,510 packages.buskill DEBUG device:|Bus 000 Device 003: ID 19f7:001c|
23:16:32,510 packages.buskill DEBUG event:|1|
23:16:32,510 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:16:32,510 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:16:32,510 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:16:32,510 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:16:32,510 packages.buskill DEBUG device:|Bus 000 Device 002: ID 0bda:1100|
23:16:32,510 packages.buskill DEBUG event:|1|
23:16:32,510 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:16:32,510 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:16:32,510 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:16:32,510 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:16:32,510 packages.buskill DEBUG device:|Bus 000 Device 001: ID 0bda:5411|
23:16:32,510 packages.buskill DEBUG event:|1|
23:16:32,510 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:16:32,510 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:43:55,565 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:43:55,573 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:43:55,573 packages.buskill DEBUG device:|Bus 001 Device 005: ID 21c4:8005|
23:43:55,573 packages.buskill DEBUG event:|2|
23:43:55,573 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:43:55,573 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:43:55,573 packages.buskill INFO INFO: Detected USB removal event
23:43:55,574 packages.buskill DEBUG calling <bound method BusKill.triggerMac of <packages.buskill.BusKill object at 0x10cb26f50>>
23:43:55,595 packages.buskill ERROR DEBUG: Queue message from child usb_handler (trigger)
23:43:55,596 packages.buskill DEBUG DEBUG: BusKill soft-shutdown trigger executing now
23:43:55,596 packages.buskill DEBUG DEBUG: Attempting to send 'soft-shutdown' command to root child
23:43:55,632 packages.buskill ERROR ERROR: Failed to send 'soft-shutdown' command to root child
'NoneType' object is not subscriptable
23:44:00,738 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:44:00,738 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:44:00,738 packages.buskill DEBUG device:|Bus 001 Device 005: ID 21c4:8005|
23:44:00,738 packages.buskill DEBUG event:|1|
23:44:00,738 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:44:00,739 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:44:02,200 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:44:02,201 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:44:02,201 packages.buskill DEBUG device:|Bus 001 Device 005: ID 21c4:8005|
23:44:02,201 packages.buskill DEBUG event:|2|
23:44:02,202 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:44:02,202 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:44:02,202 packages.buskill INFO INFO: Detected USB removal event
23:44:02,202 packages.buskill DEBUG calling <bound method BusKill.triggerMac of <packages.buskill.BusKill object at 0x10cb26f50>>
23:44:02,215 packages.buskill ERROR DEBUG: Queue message from child usb_handler (trigger)
23:44:02,216 packages.buskill DEBUG DEBUG: BusKill soft-shutdown trigger executing now
23:44:02,216 packages.buskill DEBUG DEBUG: Attempting to send 'soft-shutdown' command to root child
23:44:02,218 packages.buskill ERROR ERROR: Failed to send 'soft-shutdown' command to root child
'NoneType' object is not subscriptable
23:44:05,346 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:44:05,347 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:44:05,347 packages.buskill DEBUG device:|Bus 001 Device 005: ID 21c4:8005|
23:44:05,347 packages.buskill DEBUG event:|1|
23:44:05,347 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:44:05,347 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:44:11,673 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:44:11,674 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:44:11,674 packages.buskill DEBUG device:|Bus 001 Device 005: ID 21c4:8005|
23:44:11,674 packages.buskill DEBUG event:|2|
23:44:11,674 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:44:11,674 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:44:11,675 packages.buskill INFO INFO: Detected USB removal event
23:44:11,675 packages.buskill DEBUG calling <bound method BusKill.triggerMac of <packages.buskill.BusKill object at 0x10cb26f50>>
23:44:11,686 packages.buskill ERROR DEBUG: Queue message from child usb_handler (trigger)
23:44:11,686 packages.buskill DEBUG DEBUG: BusKill soft-shutdown trigger executing now
23:44:11,686 packages.buskill DEBUG DEBUG: Attempting to send 'soft-shutdown' command to root child
23:44:11,687 packages.buskill ERROR ERROR: Failed to send 'soft-shutdown' command to root child
'NoneType' object is not subscriptable
23:44:14,563 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:44:14,564 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10c847fd0>|
23:44:14,564 packages.buskill DEBUG device:|Bus 001 Device 005: ID 21c4:8005|
23:44:14,564 packages.buskill DEBUG event:|1|
23:44:14,564 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:44:14,564 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:44:20,805 buskill_gui DEBUG DEBUG: User switched to 'DebugLog' screen
23:45:06,410 kivy INFO [WindowSDL ] exiting mainloop and closing.
23:45:06,475 kivy INFO [Base ] Leaving application in progress...
23:45:06,477 kivy WARNING stderr: [INFO/MainProcess] process shutting down
23:45:06,477 kivy WARNING stderr: [DEBUG/MainProcess] running all "atexit" finalizers with priority >= 0
23:45:06,477 kivy WARNING stderr: [DEBUG/MainProcess] running the remaining "atexit" finalizers
23:45:39,439 root INFO ===============================================================================
23:45:39,439 root INFO INFO: Writing to log file '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/buskill.log'
23:45:39,439 root DEBUG BUSKILL_VERSION|{'VERSION': 'v0.7.0', 'GITHUB_REF': 'refs/heads/v0.7.0', 'GITHUB_SHA': '4139a515ea941dba3fffe5714226b135569f46e2', 'SOURCE_DATE_EPOCH': '1687039680'}|
23:45:39,439 root DEBUG os.environ|environ({'USER': 'dh', 'COMMAND_MODE': 'unix2003', '__CFBundleIdentifier': 'buskill-v0.7.0', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'LOGNAME': 'dh', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.pCgGfrvZHC/Listeners', 'HOME': '/Users/dh', 'SHELL': '/bin/zsh', 'TMPDIR': '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'XPC_SERVICE_NAME': 'application.buskill-v0.7.0.18450406.18450465', 'XPC_FLAGS': '0x0', 'KIVY_DATA_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/data', 'KIVY_MODULES_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/modules', 'GST_REGISTRY_FORK': 'no', 'GST_PLUGIN_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app/Contents/MacOS/gst-plugins', 'GST_REGISTRY': '/Applications/buskill-v0.7.0.app/Contents/MacOS/registry.bin', 'GST_PLUGIN_SYSTEM_PATH': ''})|
23:45:39,439 root DEBUG sys.argv|['/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill']|
23:45:39,439 root DEBUG sys.builtin_modules_names|('_abc', '_ast', '_codecs', '_collections', '_functools', '_imp', '_io', '_locale', '_operator', '_signal', '_sre', '_stat', '_string', '_symtable', '_thread', '_tracemalloc', '_warnings', '_weakref', 'atexit', 'builtins', 'errno', 'faulthandler', 'gc', 'itertools', 'marshal', 'posix', 'pwd', 'sys', 'time', 'xxsubtype', 'zipimport')|
23:45:39,439 root DEBUG sys.executable|/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill|
23:45:39,439 root DEBUG sys.path|['/Applications/buskill-v0.7.0.app/Contents/MacOS/base_library.zip', '/Applications/buskill-v0.7.0.app/Contents/MacOS/lib-dynload', '/Applications/buskill-v0.7.0.app/Contents/MacOS']|
23:45:39,439 root DEBUG sys.prefix|/Applications/buskill-v0.7.0.app/Contents/MacOS|
23:45:39,439 root DEBUG sys.version|3.7.8 (default, Jul 4 2020, 10:17:17)
[Clang 11.0.3 (clang-1103.0.32.62)]|
23:45:39,439 root DEBUG sys.api_version|1013|
23:45:39,439 root DEBUG sys.version_info|sys.version_info(major=3, minor=7, micro=8, releaselevel='final', serial=0)|
23:45:39,439 root DEBUG name|main|
23:45:39,439 root DEBUG sys.platform|darwin|
23:45:39,453 root DEBUG platform.platform()|Darwin-23.2.0-x86_64-i386-64bit|
23:45:39,453 root DEBUG platform.system()|Darwin|
23:45:39,453 root DEBUG platform.release()|23.2.0|
23:45:39,453 root DEBUG platform.version()|Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.32/RELEASE_ARM64_T8103|
23:45:39,453 root DEBUG platform.machine()|x86_64|
23:45:39,453 root DEBUG platform.uname()|uname_result(system='Darwin', node='Ss-MacBook-Air.local', release='23.2.0', version='Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.3
2/RELEASE_ARM64_T8103', machine='x86_64', processor='i386')|
23:45:39,453 root DEBUG platform.mac_ver()|('10.16', ('', '', ''), 'x86_64')|
23:45:39,453 root INFO buskill version {'VERSION': 'v0.7.0', 'GITHUB_REF': 'refs/heads/v0.7.0', 'GITHUB_SHA': '4139a515ea941dba3fffe5714226b135569f46e2', 'SOURCE_DATE_EPOCH': '1687039680'}
23:45:39,454 packages.buskill DEBUG DEBUG: EXECUTED_AS_SCRIPT:|False|
DEBUG: EXE_PATH:|/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill|
DEBUG: EXE_DIR:|/Applications/buskill-v0.7.0.app/Contents/MacOS|
DEBUG: EXE_FILE:|buskill|
DEBUG: APP_DIR:|/Applications/buskill-v0.7.0.app|
DEBUG: APPS_DIR:|/Applications|
DEBUG: SRC_DIR:|/Applications/buskill-v0.7.0.app/Contents/MacOS|
DEBUG: os.environ['PATH']:|/usr/bin:/bin:/usr/sbin:/sbin:/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app|

23:45:39,454 packages.buskill INFO INFO: using DATA_DIR:|/Applications/.buskill|
23:45:39,455 packages.buskill DEBUG DEBUG: CONF_FILE:|/Applications/.buskill/config.ini|

23:45:39,462 kivy INFO [Logger ] Record log in /Applications/.buskill/logs/kivy_24-02-25_1.txt
23:45:39,462 kivy INFO [Kivy ] v1.11.1
23:45:39,462 kivy INFO [Kivy ] Installed at "/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy/init.pyc"
23:45:39,462 kivy INFO [Python ] v3.7.8 (default, Jul 4 2020, 10:17:17)
[Clang 11.0.3 (clang-1103.0.32.62)]
23:45:39,462 kivy INFO [Python ] Interpreter at "/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill"
23:45:39,484 kivy INFO [Factory ] 184 symbols loaded
23:45:39,605 kivy INFO [Image ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
23:45:39,733 kivy INFO [Window ] Provider: sdl2
23:45:40,122 kivy INFO [GL ] Using the "OpenGL ES 2" graphics system
23:45:40,123 kivy INFO [GL ] Backend used
23:45:40,124 kivy INFO [GL ] OpenGL version <b'2.1 Metal - 88'>
23:45:40,124 kivy INFO [GL ] OpenGL vendor <b'Apple'>
23:45:40,124 kivy INFO [GL ] OpenGL renderer <b'Apple M1'>
23:45:40,124 kivy INFO [GL ] OpenGL parsed version: 2, 1
23:45:40,124 kivy INFO [GL ] Shading version <b'1.20'>
23:45:40,124 kivy INFO [GL ] Texture max size <16384>
23:45:40,124 kivy INFO [GL ] Texture max units <16>
23:45:40,184 kivy INFO [Window ] auto add sdl2 input provider
23:45:40,213 kivy INFO [Window ] virtual keyboard not allowed, single mode, not docked
23:45:40,226 kivy INFO [Text ] Provider: sdl2
23:45:40,229 kivy INFO [Clipboard ] Provider: sdl2(['clipboard_nspaste'] ignored)
23:45:40,278 kivy INFO [GL ] NPOT texture support is available
23:45:40,307 buskill_gui DEBUG DEBUG: adding screen:||
23:45:40,307 buskill_gui DEBUG DEBUG: User switched to 'MainWindow' screen
23:45:40,307 buskill_gui DEBUG DEBUG: adding screen:||
23:45:40,307 buskill_gui DEBUG DEBUG: adding screen:||
23:45:40,317 kivy INFO [Base ] Start application main loop
23:45:41,403 packages.buskill DEBUG DEBUG: Attempting to set 'trigger' set to 'soft-shutdown'
23:45:41,404 packages.buskill DEBUG DEBUG: Called spawn_root_child()
23:45:41,404 packages.buskill DEBUG DEBUG: No root_child detected. Attempting to spawn one.
23:45:41,404 packages.buskill INFO INFO: You have requested BusKill to do something that requires elevated privliges on your platform. If you'd like to proceed, please authorize BusKill to preform actions as Administrator. Your system may prompt you for your password to proceed.
23:45:41,404 packages.buskill DEBUG DEBUG: root_child_path:|/Applications/buskill-v0.7.0.app/Contents/MacOS/root_child_mac|
23:45:41,405 packages.buskill ERROR ERROR: root_child is not owned by gid=0 nor your group. Refusing to spawn script as root!
23:45:41,405 packages.buskill INFO INFO: BusKill 'trigger' set to 'soft-shutdown'
23:45:41,405 packages.buskill DEBUG DEBUG: attempting to arm BusKill via <bound method BusKill.armNix of <packages.buskill.BusKill object at 0x10c73fd90>>() with the 'soft-shutdown' trigger
23:45:41,416 kivy WARNING stderr: [DEBUG/MainProcess] created semlock with handle 20
23:45:41,432 kivy WARNING stderr: [DEBUG/MainProcess] created semlock with handle 21
23:45:41,433 kivy WARNING stderr: [DEBUG/MainProcess] created semlock with handle 23
23:45:41,433 kivy WARNING stderr: [DEBUG/MainProcess] Queue._after_fork()
23:45:41,435 packages.buskill DEBUG DEBUG:getstate() pre:dict_keys(['CURRENT_PLATFORM', 'KERNEL_VERSION', 'IS_PLATFORM_SUPPORTED', 'OS_NAME_SHORT', 'ERR_PLATFORM_NOT_SUPPORTED', 'ARM_FUNCTION', 'DISARM_FUNCTION', 'TRIGGER_FUNCTION', 'SIMULATE_HOTPLUG_REMOVAL', 'EXECUTED_AS_SCRIPT', 'LOG_FILE_PATH', 'EXE_PATH', 'EXE_DIR', 'EXE_FILE', 'APP_DIR', 'APPS_DIR', 'SRC_DIR', 'DATA_DIR', 'CACHE_DIR', 'CONF_FILE', 'GNUPGHOME', 'UPGRADED_FROM', 'UPGRADED_TO', 'root_child', 'is_armed', 'usb_handler', 'usb_handler_queue', 'upgrade_status_msg', 'upgrade_result', 'trigger', 'SUPPORTED_TRIGGERS', 'trigger_softshutdown_lin_shutdown_path', 'trigger_softshutdown_lin_poweroff_path', 'trigger_softshutdown_lin_systemctl_path', 'url_website', 'url_documentation', 'url_documentation_contribute', 'url_documentation_bug_report', 'url_documentation_gui', 'config'])|
23:45:41,435 packages.buskill DEBUG DEBUG:getstate() post:|dict_keys(['CURRENT_PLATFORM', 'KERNEL_VERSION', 'IS_PLATFORM_SUPPORTED', 'OS_NAME_SHORT', 'ERR_PLATFORM_NOT_SUPPORTED', 'ARM_FUNCTION', 'DISARM_FUNCTION', 'TRIGGER_FUNCTION', 'SIMULATE_HOTPLUG_REMOVAL', 'EXECUTED_AS_SCRIPT', 'LOG_FILE_PATH', 'EXE_PATH', 'EXE_DIR', 'EXE_FILE', 'APP_DIR', 'APPS_DIR', 'SRC_DIR', 'DATA_DIR', 'CACHE_DIR', 'CONF_FILE', 'GNUPGHOME', 'UPGRADED_FROM', 'UPGRADED_TO', 'is_armed', 'usb_handler_queue', 'upgrade_status_msg', 'upgrade_result', 'trigger', 'SUPPORTED_TRIGGERS', 'trigger_softshutdown_lin_shutdown_path', 'trigger_softshutdown_lin_poweroff_path', 'trigger_softshutdown_lin_systemctl_path', 'url_website', 'url_documentation', 'url_documentation_contribute', 'url_documentation_bug_report', 'url_documentation_gui', 'config'])|
23:45:41,445 packages.buskill INFO INFO: BusKill is armed. Listening for removal event.
INFO: To disarm the CLI, exit with ^C or close this terminal
23:45:41,618 root INFO ===============================================================================
23:45:41,618 root INFO INFO: Writing to log file '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/buskill.log'
23:45:41,618 root DEBUG BUSKILL_VERSION|{'VERSION': 'v0.7.0', 'GITHUB_REF': 'refs/heads/v0.7.0', 'GITHUB_SHA': '4139a515ea941dba3fffe5714226b135569f46e2', 'SOURCE_DATE_EPOCH': '1687039680'}|
23:45:41,619 root DEBUG os.environ|environ({'USER': 'dh', 'COMMAND_MODE': 'unix2003', '__CFBundleIdentifier': 'buskill-v0.7.0', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin:/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app', 'LOGNAME': 'dh', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.pCgGfrvZHC/Listeners', 'HOME': '/Users/dh', 'SHELL': '/bin/zsh', 'TMPDIR': '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'XPC_SERVICE_NAME': '0', 'XPC_FLAGS': '0x0', 'KIVY_DATA_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/data', 'KIVY_MODULES_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/modules', 'GST_REGISTRY_FORK': 'no', 'GST_PLUGIN_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app/Contents/MacOS/gst-plugins', 'GST_REGISTRY': '/Applications/buskill-v0.7.0.app/Contents/MacOS/registry.bin', 'GST_PLUGIN_SYSTEM_PATH': '', 'DYLD_FALLBACK_LIBRARY_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS', 'KIVY_HOME': '/Applications/.buskill'})|
23:45:41,619 root DEBUG sys.argv|['/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill', '-B', '-S', '-E', '-s', '-c', 'from multiprocessing.semaphore_tracker import main;main(21)']|
23:45:41,619 root DEBUG sys.builtin_modules_names|('_abc', '_ast', '_codecs', '_collections', '_functools', '_imp', '_io', '_locale', '_operator', '_signal', '_sre', '_stat', '_string', '_symtable', '_thread', '_tracemalloc', '_warnings', '_weakref', 'atexit', 'builtins', 'errno', 'faulthandler', 'gc', 'itertools', 'marshal', 'posix', 'pwd', 'sys', 'time', 'xxsubtype', 'zipimport')|
23:45:41,619 root DEBUG sys.executable|/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill|
23:45:41,619 root DEBUG sys.path|['/Applications/buskill-v0.7.0.app/Contents/MacOS/base_library.zip', '/Applications/buskill-v0.7.0.app/Contents/MacOS/lib-dynload', '/Applications/buskill-v0.7.0.app/Contents/MacOS']|
23:45:41,619 root DEBUG sys.prefix|/Applications/buskill-v0.7.0.app/Contents/MacOS|
23:45:41,619 root DEBUG sys.version|3.7.8 (default, Jul 4 2020, 10:17:17)
[Clang 11.0.3 (clang-1103.0.32.62)]|
23:45:41,619 root DEBUG sys.api_version|1013|
23:45:41,619 root DEBUG sys.version_info|sys.version_info(major=3, minor=7, micro=8, releaselevel='final', serial=0)|
23:45:41,619 root DEBUG name|main|
23:45:41,619 root DEBUG sys.platform|darwin|
23:45:41,622 root INFO ===============================================================================
23:45:41,622 root INFO INFO: Writing to log file '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/buskill.log'
23:45:41,622 root DEBUG BUSKILL_VERSION|{'VERSION': 'v0.7.0', 'GITHUB_REF': 'refs/heads/v0.7.0', 'GITHUB_SHA': '4139a515ea941dba3fffe5714226b135569f46e2', 'SOURCE_DATE_EPOCH': '1687039680'}|
23:45:41,622 root DEBUG os.environ|environ({'USER': 'dh', 'COMMAND_MODE': 'unix2003', '__CFBundleIdentifier': 'buskill-v0.7.0', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin:/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app', 'LOGNAME': 'dh', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.pCgGfrvZHC/Listeners', 'HOME': '/Users/dh', 'SHELL': '/bin/zsh', 'TMPDIR': '/var/folders/yj/pv3cnb7d5c9_s1xdsg_ztvbh0000gn/T/', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'XPC_SERVICE_NAME': '0', 'XPC_FLAGS': '0x0', 'KIVY_DATA_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/data', 'KIVY_MODULES_DIR': '/Applications/buskill-v0.7.0.app/Contents/MacOS/kivy_install/modules', 'GST_REGISTRY_FORK': 'no', 'GST_PLUGIN_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS:/Applications/buskill-v0.7.0.app/Contents/MacOS/gst-plugins', 'GST_REGISTRY': '/Applications/buskill-v0.7.0.app/Contents/MacOS/registry.bin', 'GST_PLUGIN_SYSTEM_PATH': '', 'DYLD_FALLBACK_LIBRARY_PATH': '/Applications/buskill-v0.7.0.app/Contents/MacOS', 'KIVY_HOME': '/Applications/.buskill'})|
23:45:41,622 root DEBUG sys.argv|['/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill', '--multiprocessing-fork', 'tracker_fd=22', 'pipe_handle=28']|
23:45:41,622 root DEBUG sys.builtin_modules_names|('_abc', '_ast', '_codecs', '_collections', '_functools', '_imp', '_io', '_locale', '_operator', '_signal', '_sre', '_stat', '_string', '_symtable', '_thread', '_tracemalloc', '_warnings', '_weakref', 'atexit', 'builtins', 'errno', 'faulthandler', 'gc', 'itertools', 'marshal', 'posix', 'pwd', 'sys', 'time', 'xxsubtype', 'zipimport')|
23:45:41,622 root DEBUG sys.executable|/Applications/buskill-v0.7.0.app/Contents/MacOS/buskill|
23:45:41,622 root DEBUG sys.path|['/Applications/buskill-v0.7.0.app/Contents/MacOS/base_library.zip', '/Applications/buskill-v0.7.0.app/Contents/MacOS/lib-dynload', '/Applications/buskill-v0.7.0.app/Contents/MacOS']|
23:45:41,622 root DEBUG sys.prefix|/Applications/buskill-v0.7.0.app/Contents/MacOS|
23:45:41,622 root DEBUG sys.version|3.7.8 (default, Jul 4 2020, 10:17:17)
[Clang 11.0.3 (clang-1103.0.32.62)]|
23:45:41,622 root DEBUG sys.api_version|1013|
23:45:41,622 root DEBUG sys.version_info|sys.version_info(major=3, minor=7, micro=8, releaselevel='final', serial=0)|
23:45:41,622 root DEBUG name|main|
23:45:41,622 root DEBUG sys.platform|darwin|
23:45:41,628 root DEBUG platform.platform()|Darwin-23.2.0-x86_64-i386-64bit|
23:45:41,628 root DEBUG platform.system()|Darwin|
23:45:41,628 root DEBUG platform.release()|23.2.0|
23:45:41,628 root DEBUG platform.version()|Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.32/RELEASE_ARM64_T8103|
23:45:41,628 root DEBUG platform.machine()|x86_64|
23:45:41,628 root DEBUG platform.uname()|uname_result(system='Darwin', node='Ss-MacBook-Air.local', release='23.2.0', version='Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.3
2/RELEASE_ARM64_T8103', machine='x86_64', processor='i386')|
23:45:41,629 root DEBUG platform.mac_ver()|('10.16', ('', '', ''), 'x86_64')|
23:45:41,631 root DEBUG platform.platform()|Darwin-23.2.0-x86_64-i386-64bit|
23:45:41,631 root DEBUG platform.system()|Darwin|
23:45:41,631 root DEBUG platform.release()|23.2.0|
23:45:41,631 root DEBUG platform.version()|Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.32/RELEASE_ARM64_T8103|
23:45:41,631 root DEBUG platform.machine()|x86_64|
23:45:41,631 root DEBUG platform.uname()|uname_result(system='Darwin', node='Ss-MacBook-Air.local', release='23.2.0', version='Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.3
2/RELEASE_ARM64_T8103', machine='x86_64', processor='i386')|
23:45:41,631 root DEBUG platform.mac_ver()|('10.16', ('', '', ''), 'x86_64')|
23:45:41,646 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:45:41,646 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:45:41,646 packages.buskill DEBUG device:|Bus 001 Device 005: ID 21c4:8005|
23:45:41,646 packages.buskill DEBUG event:|1|
23:45:41,646 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:45:41,646 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:45:41,646 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:45:41,646 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:45:41,646 packages.buskill DEBUG device:|Bus 001 Device 004: ID 2109:8817|
23:45:41,646 packages.buskill DEBUG event:|1|
23:45:41,646 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:45:41,646 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:45:41,646 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:45:41,646 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:45:41,646 packages.buskill DEBUG device:|Bus 001 Device 003: ID 0bda:8153|
23:45:41,646 packages.buskill DEBUG event:|1|
23:45:41,646 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:45:41,646 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:45:41,646 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:45:41,646 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:45:41,646 packages.buskill DEBUG device:|Bus 001 Device 002: ID 2109:0817|
23:45:41,646 packages.buskill DEBUG event:|1|
23:45:41,646 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:45:41,647 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:45:41,647 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:45:41,647 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:45:41,647 packages.buskill DEBUG device:|Bus 001 Device 001: ID 2109:2817|
23:45:41,647 packages.buskill DEBUG event:|1|
23:45:41,647 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:45:41,647 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:45:41,647 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:45:41,647 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:45:41,647 packages.buskill DEBUG device:|Bus 000 Device 005: ID 1d50:6124|
23:45:41,647 packages.buskill DEBUG event:|1|
23:45:41,647 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:45:41,647 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:45:41,647 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:45:41,647 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:45:41,647 packages.buskill DEBUG device:|Bus 000 Device 004: ID 045e:082a|
23:45:41,647 packages.buskill DEBUG event:|1|
23:45:41,647 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:45:41,647 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:45:41,647 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:45:41,647 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:45:41,647 packages.buskill DEBUG device:|Bus 000 Device 003: ID 19f7:001c|
23:45:41,647 packages.buskill DEBUG event:|1|
23:45:41,647 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:45:41,647 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:45:41,647 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:45:41,647 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:45:41,647 packages.buskill DEBUG device:|Bus 000 Device 002: ID 0bda:1100|
23:45:41,647 packages.buskill DEBUG event:|1|
23:45:41,647 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:45:41,647 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:45:41,647 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:45:41,647 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:45:41,647 packages.buskill DEBUG device:|Bus 000 Device 001: ID 0bda:5411|
23:45:41,647 packages.buskill DEBUG event:|1|
23:45:41,647 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:45:41,647 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:45:43,577 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:45:43,577 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:45:43,578 packages.buskill DEBUG device:|Bus 001 Device 005: ID 21c4:8005|
23:45:43,578 packages.buskill DEBUG event:|2|
23:45:43,578 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:45:43,578 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:45:43,578 packages.buskill INFO INFO: Detected USB removal event
23:45:43,579 packages.buskill DEBUG calling <bound method BusKill.triggerMac of <packages.buskill.BusKill object at 0x10acc8110>>
23:45:43,587 packages.buskill ERROR DEBUG: Queue message from child usb_handler (trigger)
23:45:43,587 packages.buskill DEBUG DEBUG: BusKill soft-shutdown trigger executing now
23:45:43,587 packages.buskill DEBUG DEBUG: Attempting to send 'soft-shutdown' command to root child
23:45:43,589 packages.buskill ERROR ERROR: Failed to send 'soft-shutdown' command to root child
'NoneType' object is not subscriptable
23:45:50,817 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:45:50,818 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:45:50,818 packages.buskill DEBUG device:|Bus 001 Device 005: ID 21c4:8005|
23:45:50,818 packages.buskill DEBUG event:|1|
23:45:50,818 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:45:50,818 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:46:54,235 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:46:54,238 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:46:54,240 packages.buskill DEBUG device:|Bus 001 Device 005: ID 21c4:8005|
23:46:54,240 packages.buskill DEBUG event:|2|
23:46:54,240 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:46:54,240 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:46:54,240 packages.buskill INFO INFO: Detected USB removal event
23:46:54,241 packages.buskill DEBUG calling <bound method BusKill.triggerMac of <packages.buskill.BusKill object at 0x10acc8110>>
23:46:54,258 packages.buskill ERROR DEBUG: Queue message from child usb_handler (trigger)
23:46:54,259 packages.buskill DEBUG DEBUG: BusKill soft-shutdown trigger executing now
23:46:54,259 packages.buskill DEBUG DEBUG: Attempting to send 'soft-shutdown' command to root child
23:46:54,260 packages.buskill ERROR ERROR: Failed to send 'soft-shutdown' command to root child
'NoneType' object is not subscriptable
23:46:56,101 packages.buskill DEBUG DEBUG: called hotplugCallbackNix()
23:46:56,101 packages.buskill DEBUG context:|<usb1.USBContext object at 0x10a9da150>|
23:46:56,102 packages.buskill DEBUG device:|Bus 001 Device 005: ID 21c4:8005|
23:46:56,102 packages.buskill DEBUG event:|1|
23:46:56,102 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_ARRIVED:|1|
23:46:56,102 packages.buskill DEBUG usb1.HOTPLUG_EVENT_DEVICE_LEFT:|2|
23:46:59,55 buskill_gui DEBUG DEBUG: User switched to 'DebugLog' screen

@maltfield
Copy link
Member

maltfield commented Feb 25, 2024

I browsed online and I have found that root:wheel: Specifies the new owner (root) and group (wheel). On macOS, wheel is a traditional group name for the system administrator group, similar to root.

@samxplogs try setting the uid and gid to 0

Also, don't change the .app dir's permissions. The file whose permissions that are relevant here are the root child script /Applications/buskill-v0.7.0.app/Contents/MacOS/root_child_mac

For example:

sudo chown 0:0 /Applications/buskill-v0.7.0.app/Contents/MacOS/root_child_mac

@maltfield
Copy link
Member

On our cloud mac mini, we have owner of maltfield:staff = 502:20.

I just did an install of the BusKill v0.7.0 app on our cloud mac mini. We have basically the same user owner (50X) as this report, but the group owner (for which this error is thrown) is different.

OP has group owner admin w/ gid = 80

$ ls -lah /Applications/buskill-v0.7.0.app/Contents/MacOS/
...
-r-x------@ 1 dh admin 609K Jun 18 2023 root_child_mac
$

$ ls -lahn /Applications/buskill-v0.7.0.app/Contents/MacOS/
-r-x------@ 1 501 80 609K Jun 18 2023 root_child_mac

And we have staff w/ gid = 20

maltfield@host ~ % ls -lah Desktop/buskill-v0.7.0.app/Contents/MacOS
...
-r-x------   1 maltfield  staff   609K Jun 16  2023 root_child_mac
maltfield@host ~ %

maltfield@host ~ % ls -lahn Desktop/buskill-v0.7.0.app/Contents/MacOS
...
-r-x------   1 502  20   609K Jun 16  2023 root_child_mac
maltfield@host ~ % 

That explains why this didn't get detected in our tests. On our machine, my user maltfield is a member of the staff group. But I guess OP's user is not a member of the admin group.

# verify the file is owned by group = root (or current group)
if group != 0 and group != os.getgid():
msg = 'ERROR: root_child is not owned by gid=0 nor your group. Refusing to spawn script as root!'
print( msg ); logger.error( msg )
return False

For reference, here's our full ls output

maltfield@host ~ % ls -lah Desktop/buskill-v0.7.0.app/Contents/MacOS
total 29512
drwxr-xr-x  46 maltfield  staff   1.4K Jun 16  2023 .
drwxr-xr-x   7 maltfield  staff   224B Jun 16  2023 ..
-rwxr-xr-x   1 maltfield  staff   271K Jun 16  2023 FLAC
-rwxr-xr-x   1 maltfield  staff   727K Jun 16  2023 FreeType
lrwxr-xr-x   1 maltfield  staff    17B Jun 16  2023 KEYS -> ../Resources/KEYS
-rwxr-xr-x   1 maltfield  staff    47K Jun 16  2023 Ogg
-rwxr-xr-x   1 maltfield  staff   2.3M Jun 16  2023 Python
-rwxr-xr-x   1 maltfield  staff   1.3M Jun 16  2023 SDL2
-rwxr-xr-x   1 maltfield  staff   136K Jun 16  2023 SDL2_image
-rwxr-xr-x   1 maltfield  staff   133K Jun 16  2023 SDL2_mixer
-rwxr-xr-x   1 maltfield  staff    48K Jun 16  2023 SDL2_ttf
-rwxr-xr-x   1 maltfield  staff   931K Jun 16  2023 Vorbis
lrwxr-xr-x   1 maltfield  staff    24B Jun 16  2023 __pycache__ -> ../Resources/__pycache__
lrwxr-xr-x   1 maltfield  staff    29B Jun 16  2023 base_library.zip -> ../Resources/base_library.zip
-rwxr-xr-x   1 maltfield  staff   4.2M Jun 16  2023 buskill
lrwxr-xr-x   1 maltfield  staff    33B Jun 16  2023 buskill-icon-150.png -> ../Resources/buskill-icon-150.png
lrwxr-xr-x   1 maltfield  staff    30B Jun 16  2023 buskill-icon.icns -> ../Resources/buskill-icon.icns
lrwxr-xr-x   1 maltfield  staff    23B Jun 16  2023 buskill.kv -> ../Resources/buskill.kv
lrwxr-xr-x   1 maltfield  staff    27B Jun 16  2023 buskill_cli.py -> ../Resources/buskill_cli.py
lrwxr-xr-x   1 maltfield  staff    27B Jun 16  2023 buskill_gui.py -> ../Resources/buskill_gui.py
lrwxr-xr-x   1 maltfield  staff    31B Jun 16  2023 buskill_version.py -> ../Resources/buskill_version.py
lrwxr-xr-x   1 maltfield  staff    20B Jun 16  2023 certifi -> ../Resources/certifi
lrwxr-xr-x   1 maltfield  staff    21B Jun 16  2023 docutils -> ../Resources/docutils
lrwxr-xr-x   1 maltfield  staff    18B Jun 16  2023 fonts -> ../Resources/fonts
lrwxr-xr-x   1 maltfield  staff    16B Jun 16  2023 gpg -> ../Resources/gpg
lrwxr-xr-x   1 maltfield  staff    19B Jun 16  2023 images -> ../Resources/images
drwxr-xr-x   9 maltfield  staff   288B Jun 16  2023 kivy
lrwxr-xr-x   1 maltfield  staff    25B Jun 16  2023 kivy_install -> ../Resources/kivy_install
drwxr-xr-x  51 maltfield  staff   1.6K Jun 16  2023 lib-dynload
lrwxr-xr-x   1 maltfield  staff    30B Jun 16  2023 libassuan.0.dylib -> ../Resources/libassuan.0.dylib
-rwxr-xr-x   1 maltfield  staff   2.3M Jun 16  2023 libcrypto.1.1.dylib
lrwxr-xr-x   1 maltfield  staff    31B Jun 16  2023 libgcrypt.20.dylib -> ../Resources/libgcrypt.20.dylib
lrwxr-xr-x   1 maltfield  staff    33B Jun 16  2023 libgpg-error.0.dylib -> ../Resources/libgpg-error.0.dylib
lrwxr-xr-x   1 maltfield  staff    28B Jun 16  2023 libintl.8.dylib -> ../Resources/libintl.8.dylib
lrwxr-xr-x   1 maltfield  staff    22B Jun 16  2023 libintl.a -> ../Resources/libintl.a
lrwxr-xr-x   1 maltfield  staff    26B Jun 16  2023 libintl.dylib -> ../Resources/libintl.dylib
-rwxr-xr-x   1 maltfield  staff   197K Jun 16  2023 liblzma.5.dylib
lrwxr-xr-x   1 maltfield  staff    28B Jun 16  2023 libnpth.0.dylib -> ../Resources/libnpth.0.dylib
-rwxr-xr-x   1 maltfield  staff   288K Jun 16  2023 libreadline.8.dylib
-rwxr-xr-x   1 maltfield  staff   510K Jun 16  2023 libssl.1.1.dylib
lrwxr-xr-x   1 maltfield  staff    29B Jun 16  2023 libusb-1.0.dylib -> ../Resources/libusb-1.0.dylib
lrwxr-xr-x   1 maltfield  staff    20B Jun 16  2023 main.py -> ../Resources/main.py
-rwxr-xr-x   1 maltfield  staff   226K Jun 16  2023 modplug
-rwxr-xr-x   1 maltfield  staff   271K Jun 16  2023 mpg123
lrwxr-xr-x   1 maltfield  staff    21B Jun 16  2023 packages -> ../Resources/packages
-r-x------   1 maltfield  staff   609K Jun 16  2023 root_child_mac
maltfield@host ~ %

maltfield@host ~ % ls -lahn Desktop/buskill-v0.7.0.app/Contents/MacOS
total 29512
drwxr-xr-x  46 502  20   1.4K Jun 16  2023 .
drwxr-xr-x   7 502  20   224B Jun 16  2023 ..
-rwxr-xr-x   1 502  20   271K Jun 16  2023 FLAC
-rwxr-xr-x   1 502  20   727K Jun 16  2023 FreeType
lrwxr-xr-x   1 502  20    17B Jun 16  2023 KEYS -> ../Resources/KEYS
-rwxr-xr-x   1 502  20    47K Jun 16  2023 Ogg
-rwxr-xr-x   1 502  20   2.3M Jun 16  2023 Python
-rwxr-xr-x   1 502  20   1.3M Jun 16  2023 SDL2
-rwxr-xr-x   1 502  20   136K Jun 16  2023 SDL2_image
-rwxr-xr-x   1 502  20   133K Jun 16  2023 SDL2_mixer
-rwxr-xr-x   1 502  20    48K Jun 16  2023 SDL2_ttf
-rwxr-xr-x   1 502  20   931K Jun 16  2023 Vorbis
lrwxr-xr-x   1 502  20    24B Jun 16  2023 __pycache__ -> ../Resources/__pycache__
lrwxr-xr-x   1 502  20    29B Jun 16  2023 base_library.zip -> ../Resources/base_library.zip
-rwxr-xr-x   1 502  20   4.2M Jun 16  2023 buskill
lrwxr-xr-x   1 502  20    33B Jun 16  2023 buskill-icon-150.png -> ../Resources/buskill-icon-150.png
lrwxr-xr-x   1 502  20    30B Jun 16  2023 buskill-icon.icns -> ../Resources/buskill-icon.icns
lrwxr-xr-x   1 502  20    23B Jun 16  2023 buskill.kv -> ../Resources/buskill.kv
lrwxr-xr-x   1 502  20    27B Jun 16  2023 buskill_cli.py -> ../Resources/buskill_cli.py
lrwxr-xr-x   1 502  20    27B Jun 16  2023 buskill_gui.py -> ../Resources/buskill_gui.py
lrwxr-xr-x   1 502  20    31B Jun 16  2023 buskill_version.py -> ../Resources/buskill_version.py
lrwxr-xr-x   1 502  20    20B Jun 16  2023 certifi -> ../Resources/certifi
lrwxr-xr-x   1 502  20    21B Jun 16  2023 docutils -> ../Resources/docutils
lrwxr-xr-x   1 502  20    18B Jun 16  2023 fonts -> ../Resources/fonts
lrwxr-xr-x   1 502  20    16B Jun 16  2023 gpg -> ../Resources/gpg
lrwxr-xr-x   1 502  20    19B Jun 16  2023 images -> ../Resources/images
drwxr-xr-x   9 502  20   288B Jun 16  2023 kivy
lrwxr-xr-x   1 502  20    25B Jun 16  2023 kivy_install -> ../Resources/kivy_install
drwxr-xr-x  51 502  20   1.6K Jun 16  2023 lib-dynload
lrwxr-xr-x   1 502  20    30B Jun 16  2023 libassuan.0.dylib -> ../Resources/libassuan.0.dylib
-rwxr-xr-x   1 502  20   2.3M Jun 16  2023 libcrypto.1.1.dylib
lrwxr-xr-x   1 502  20    31B Jun 16  2023 libgcrypt.20.dylib -> ../Resources/libgcrypt.20.dylib
lrwxr-xr-x   1 502  20    33B Jun 16  2023 libgpg-error.0.dylib -> ../Resources/libgpg-error.0.dylib
lrwxr-xr-x   1 502  20    28B Jun 16  2023 libintl.8.dylib -> ../Resources/libintl.8.dylib
lrwxr-xr-x   1 502  20    22B Jun 16  2023 libintl.a -> ../Resources/libintl.a
lrwxr-xr-x   1 502  20    26B Jun 16  2023 libintl.dylib -> ../Resources/libintl.dylib
-rwxr-xr-x   1 502  20   197K Jun 16  2023 liblzma.5.dylib
lrwxr-xr-x   1 502  20    28B Jun 16  2023 libnpth.0.dylib -> ../Resources/libnpth.0.dylib
-rwxr-xr-x   1 502  20   288K Jun 16  2023 libreadline.8.dylib
-rwxr-xr-x   1 502  20   510K Jun 16  2023 libssl.1.1.dylib
lrwxr-xr-x   1 502  20    29B Jun 16  2023 libusb-1.0.dylib -> ../Resources/libusb-1.0.dylib
lrwxr-xr-x   1 502  20    20B Jun 16  2023 main.py -> ../Resources/main.py
-rwxr-xr-x   1 502  20   226K Jun 16  2023 modplug
-rwxr-xr-x   1 502  20   271K Jun 16  2023 mpg123
lrwxr-xr-x   1 502  20    21B Jun 16  2023 packages -> ../Resources/packages
-r-x------   1 502  20   609K Jun 16  2023 root_child_mac
maltfield@host ~ % 

@maltfield
Copy link
Member

maltfield commented Feb 26, 2024

@samxplogs could you please provide us some more info about your system's groups, so I can figure out the best approach to patch this?

Please execute the following commands as your normal dh user, and paste the output here

groups
cat /etc/group

I'll go first

maltfield@host ~ % groups
staff everyone localaccounts _appserverusr admin _appserveradm _lpadmin com.apple.sharepoint.group.1 com.apple.sharepoint.group.2 _appstore _lpoperator _developer _analyticsusers com.apple.access_ftp com.apple.access_screensharing com.apple.access_ssh-disabled com.apple.access_remote_ae com.apple.sharepoint.group.3 com.apple.sharepoint.group.4
maltfield@host ~ % 

maltfield@host ~ % cat /etc/group
##
# Group Database
# 
# Note that this file is consulted directly only when the system is running
# in single-user mode.  At other times this information is provided by
# Open Directory.
#
# See the opendirectoryd(8) man page for additional information about
# Open Directory.
##
nobody:*:-2:
nogroup:*:-1:
wheel:*:0:root
daemon:*:1:root
kmem:*:2:root
sys:*:3:root
tty:*:4:root
operator:*:5:root
mail:*:6:_teamsserver
bin:*:7:
procview:*:8:root
procmod:*:9:root
owner:*:10:
everyone:*:12:
_taskgated:*:13:_taskgated
group:*:16:
staff:*:20:root
_networkd:*:24:
_installassistant:*:25:
_lp:*:26:
_postfix:*:27:
_postdrop:*:28:
certusers:*:29:root,_jabber,_postfix,_cyrus,_calendar,_dovecot
_keytabusers:*:30:_calendar,_jabber,_postfix
_scsd:*:31:
_ces:*:32:
_appstore:*:33:_appstore
utmp:*:45:
authedusers:*:50:
interactusers:*:51:
netusers:*:52:
consoleusers:*:53:
_mcxalr:*:54:
_appleevents:*:55:
_geod:*:56:
_devdocs:*:59:
_sandbox:*:60:
localaccounts:*:61:
netaccounts:*:62:
_mdnsresponder:*:65:
_uucp:*:66:
_ard:*:67:
dialer:*:68:
network:*:69:
_www:*:70:_devicemgr,_teamsserver
_eppc:*:71:_eppc
_cvs:*:72:
_svn:*:73:
_mysql:*:74:
_sshd:*:75:
_qtss:*:76:
_mailman:*:78:
_appserverusr:*:79:
admin:*:80:root
_appserveradm:*:81:
_clamav:*:82:
_amavisd:*:83:
_jabber:*:84:
_appowner:*:87:
_windowserver:*:88:
_spotlight:*:89:
accessibility:*:90:
_tokend:*:91:
_securityagent:*:92:
_calendar:*:93:_teamsserver
_teamsserver:*:94:_devicemgr
_update_sharing:*:95:
_installer:*:96:
_atsserver:*:97:
_lpadmin:*:98:
_unknown:*:99:
_lpoperator:*:100:
_softwareupdate:*:200:_softwareupdate
_guest:*:201:
_coreaudiod:*:202:
_screensaver:*:203:
_developer:*:204:
_locationd:*:205:
_detachedsig:*:207:_locationd
_trustevaluationagent:*:208:
_odchpass:*:209:_teamsserver
_timezone:*:210:
_lda:*:211:
_cvms:*:212:
_usbmuxd:*:213:
_postgres:*:216:_devicemgr,_calendar,_teamsserver,_xserverdocs
_devicemgr:*:220:
_webauthserver:*:221:_teamsserver,_devicemgr
_netbios:*:222:
_warmd:*:224:_warmd
_dovenull:*:227:
_netstatistics:*:228:
_assetcache:*:235:
_coremediaiod:*:236:
_launchservicesd:*:239:
_iconservices:*:240:
_distnote:*:241:
_nsurlsessiond:*:242:
_nsurlstoraged:*:243:
_displaypolicyd:*:244:
_astris:*:245:
_gamecontrollerd:*:247:
_mbsetupuser:*:248:
_ondemand:*:249:
_analyticsusers:*:250:_analyticsd,_networkd,_timed,_reportmemoryexception,_mbsetupuser
_xserverdocs:*:251:
_wwwproxy:*:252:
_mobileasset:*:253:
_findmydevice:*:254:
_datadetectors:*:257:
_captiveagent:*:258:
_ctkd:*:259:
_applepay:*:260:
_hidd:*:261:
_cmiodalassistants:*:262:
_analyticsd:*:263:_analyticsd
_webdeveloper:*:264:
_fpsd:*:265:_fpsd
_timed:*:266:
_nearbyd:*:268:_nearbyd
_reportmemoryexception:*:269:_reportmemoryexception
_driverkit:*:270:_driverkit
com.apple.access_ftp:*:395:
com.apple.access_disabled:*:396:
com.apple.access_sessionkey:*:397:
com.apple.access_screensharing:*:398:
com.apple.access_ssh:*:399:
com.apple.access_remote_ae:*:400:
maltfield@host ~ % 

Interesting to note: my user appears to be member of both admin and staff groups

@maltfield
Copy link
Member

Note: this is currently blocked by issue #78:

@samxplogs
Copy link
Author

Thanks, the following command fixed the permissions
sudo chown 0:0 /Applications/buskill-v0.7.0.app/Contents/MacOS/root_child_mac

When I arm, I am prompted for my password and disconnecting the buskill volume triggered the shutdown seamlessly. Well done ! 🙏

@samxplogs
Copy link
Author

Here the details about my groups:

staff everyone localaccounts _appserverusr admin _appserveradm _lpadmin _appstore _lpoperator _developer _analyticsusers com.apple.access_ftp com.apple.access_screensharing-disabled com.apple.access_ssh com.apple.access_remote_ae com.apple.sharepoint.group.1

and output from cat /etc/group

nobody::-2:
nogroup:
👎
wheel::0:root
daemon:
:1:root
kmem::2:root
sys:
:3:root
tty::4:root
operator:
:5:root
mail::6:_teamsserver
bin:
:7:
procview::8:root
procmod:
:9:root
owner::10:
everyone:
:12:
_taskgated::13:_taskgated
group:
:16:
staff::20:root
_networkd:
:24:
_installassistant::25:
_lp:
:26:
_postfix::27:
_postdrop:
:28:
certusers::29:root,_jabber,_postfix,_cyrus,_calendar,_dovecot
_keytabusers:
:30:_calendar,_jabber,_postfix
_scsd::31:
_ces:
:32:
_appstore::33:_appstore
utmp:
:45:
authedusers::50:
interactusers:
:51:
netusers::52:
consoleusers:
:53:
_mcxalr::54:
_appleevents:
:55:
_geod::56:
_devdocs:
:59:
_sandbox::60:
localaccounts:
:61:
netaccounts::62:
_mdnsresponder:
:65:
_uucp::66:
_ard:
:67:
dialer::68:
network:
:69:
_www::70:_devicemgr,_teamsserver
_eppc:
:71:_eppc
_cvs::72:
_svn:
:73:
_mysql::74:
_sshd:
:75:
_qtss::76:
_mailman:
:78:
_appserverusr::79:
admin:
:80:root
_appserveradm::81:
_clamav:
:82:
_amavisd::83:
_jabber:
:84:
_appowner::87:
_windowserver:
:88:
_spotlight::89:
accessibility:
:90:
_tokend::91:
_securityagent:
:92:
_calendar::93:_teamsserver
_teamsserver:
:94:_devicemgr
_update_sharing::95:
_installer:
:96:
_atsserver::97:
_lpadmin:
:98:
_unknown::99:
_lpoperator:
💯
_softwareupdate::200:_softwareupdate
_guest:
:201:
_coreaudiod::202:
_screensaver:
:203:
_developer::204:
_locationd:
:205:
_detachedsig::207:_locationd
_trustevaluationagent:
:208:
_odchpass::209:_teamsserver
_timezone:
:210:
_lda::211:
_cvms:
:212:
_usbmuxd::213:
_postgres:
:216:_devicemgr,_calendar,_teamsserver,_xserverdocs
_devicemgr::220:
_webauthserver:
:221:_teamsserver,_devicemgr
_netbios::222:
_warmd:
:224:_warmd
_dovenull::227:
_netstatistics:
:228:
_assetcache::235:
_coremediaiod:
:236:
_launchservicesd::239:
_iconservices:
:240:
_distnote::241:
_nsurlsessiond:
:242:
_displaypolicyd::244:
_astris:
:245:
_gamecontrollerd::247:
_mbsetupuser:
:248:
_ondemand::249:
_analyticsusers:
:250:_analyticsd,_networkd,_timed,_reportmemoryexception,_mbsetupuser
_xserverdocs::251:
_wwwproxy:
:252:
_mobileasset::253:
_findmydevice:
:254:
_datadetectors::257:
_captiveagent:
:258:
_ctkd::259:
_applepay:
:260:
_hidd::261:
_cmiodalassistants:
:262:
_analyticsd::263:_analyticsd
_webdeveloper:
:264:
_fpsd::265:_fpsd
_timed:
:266:
_nearbyd::268:_nearbyd
_reportmemoryexception:
:269:_reportmemoryexception
_driverkit::270:_driverkit
_diskimagesiod:
:271:_diskimagesiod
_logd::272:_logd
_appinstalld:
:273:_appinstalld
_installcoordinationd::274:_installcoordinationd
_demod:
:275:_demod
_rmd::277:_rmd
_accessoryupdater:
:278:_accessoryupdater
_knowledgegraphd::279:_knowledgegraphd
_coreml:
:280:_coreml
_sntpd::281:_sntpd,_timed
_trustd:
:282:_trustd
_mmaintenanced::283:_mmaintenanced
_darwindaemon:
:284:_darwindaemon
_notification_proxy::285:
_avphidbridge:
:288:_avphidbridge
_biome::289:_biome
_backgroundassets:
:291:_backgroundassets
_mobilegestalthelper::293:
_audiomxd:
:294:
_terminusd::295:
_neuralengine:
:296:_neuralengine
com.apple.access_ftp::395:
com.apple.access_disabled:
:396:
com.apple.access_sessionkey::397:
com.apple.access_screensharing:
:398:
com.apple.access_ssh::399:
com.apple.access_remote_ae:
:400:
_oahd:*:441:_oahd

@maltfield
Copy link
Member

maltfield commented Feb 26, 2024

Whaaaat? You're in the admin group?!? Then my theory of the cause of this bug is kaput.

I'll work on a prerelease with better debug output that can hopefully explain what's going-on on your system..

Thanks, the following command fixed the permissions sudo chown 0:0 /Applications/buskill-v0.7.0.app/Contents/MacOS/root_child_mac

When I arm, I am prompted for my password and disconnecting the buskill volume triggered the shutdown seamlessly. Well done ! 🙏

It's a good workaround, but let's keep working to fix this so other users never encounter this bug ;)

maltfield added a commit that referenced this issue Feb 27, 2024
This commit also allows BusKill to launch the root_child process if it's owned by the 'admin' group (with gid=80). It appears that on some installs it gets owned by 'staff' and on others it gets owned by 'admin'. All users are already members of 'staff', so that's not a problem. But 'admin' is an even-more restrictive group, so it's actually safer to permit execution of a script as root that's owned by 'admin' than one that's owned by 'staff'

This should help fix bug #77

 * #77
maltfield added a commit that referenced this issue Feb 27, 2024
This commit adds more debug output to tell us what user & group is currently executing BusKill and what are the permissions & owners on the root_child process.

This can help resolve issues related to the permissions restrictions in-place when launching our root_child process as root, such as happened in bug #77:

 * #77
@maltfield
Copy link
Member

maltfield commented Jul 22, 2024

TODO:

1. Add better logging that outputs the owner, group, and mode of the root_child script

2. Add better logging that outputs the owner & group of the current user

3. Update root_child to actually harden/change owner, group, and mode of the root_child script on first execution

4. GUI error message if it refuses to execute root child due to unexpected permissions (link to docs with a longer description of the issue). Eg `WARNING: Unexpected permissions. Refusing to spawn root child`

Update: The BusKill CI Builds are finally fixed, so I can finally return to this ticket and implement/test the above items

@maltfield
Copy link
Member

maltfield commented Jul 22, 2024

I confirmed that #1 & #2 in the TODO list above are already done.

To implement #4, I need to setup some sort of communication between the src/packages/buskill/__init__.py's spawn_root() function to the src/buskill_gui.py's rearm_if_required() function. I'll try to see if I can raise and catch an exception. First let's see if any of the built-in exceptions meet our needs:

maltfield added a commit that referenced this issue Jul 24, 2024
This commit attempts to improve the GUI's error reporting when it fails to spawn a root_child process.

We're attempting to throw exceptions inside the buskill class, and attempting to catch them in the GUI scripts that call those functions.

 * #77 (comment)
@maltfield
Copy link
Member

I was successfully able to throw an exception in the buskill class and catch the exception & display it to the user in the GUI in the latest build

Unfortunately, it still lets the user 'arm' after it tells the user that they couldn't set the trigger due to permissions errors. Worse, it tells the user in the app that it's armed with 'soft-shutdown'. This is a lie. It cannot trigger because there is now root_child process spawned.

The best way to prevent this is to have some secondary check occur at the time that the user hits the "arm" button. Basically we should find a way to "ping" the root_child. If it doesn't "pong" back, then we should raise an error rather than let the user think that they're armed, when they're not.

TODO: update the buskill class' toggle() function to "ping" the root_child if it's arming 'soft-shutdown' on a mac. If we don't get a pong back, keep the buskill gui in the blue/disarmed state, and raise a modal error popup in the UI

@maltfield
Copy link
Member

maltfield commented Jul 25, 2024

update: I'm currently blocked again by this ticket:

@maltfield
Copy link
Member

update: I fixed the builds dependency issue above

@maltfield
Copy link
Member

maltfield commented Jul 26, 2024

I manually changed the permissions of the root_child_mac binary to 0510, and I confirmed that the UI properly displays an error when calling set_trigger() upon leaving the Settings screen.

I manually changed the user owner of the root_child_mac binary to nobody, and I confirmed that the UI properly displays an error when calling set_trigger() upon leaving the Settings screen.

I manually changed the group owner of the root_child_mac binary to everyone, and I confirmed that the UI properly displays an error when calling set_trigger() upon leaving the Settings screen.

I manually moved the root_child_mac binary to root_child_mac_actual and created a symlink to this named root_child_mac, and I confirmed that the UI properly displays an error when calling set_trigger() upon leaving the Settings screen.

I removed the link, restored the file, and was successfully prompted for my password and able to return to the main screen without an error message. I was able to arm to the 'soft-shutdown' trigger without issues.

Bonus: I restarted the app and tried to set the trigger to 'soft-shutdown' again. This time I cancelled the auth prompt to type my password. I confirmed that the UI properly displays the error returned by the OS upon leaving the Settings screen.

@maltfield
Copy link
Member

I implemented a ping/pong function in the root_child_mac.py script. And I made the toggle() function of the buskill object attempt to ping the root_child before arming (only continuing if it responded with a pong message).

I just tested the latest build on our mac mini, and I confirmed that this is working

00:41:30,846 packages.buskill DEBUG DEBUG: attempting to arm BusKill via <bound method BusKill.armNix of <packages.buskill.BusKill object at 0x10a386660>>() with the 'soft-shutdown' trigger
00:41:30,846 packages.buskill DEBUG DEBUG: Attempting to send 'ping' command to root child
00:41:30,848 root_child INFO Command received
00:41:30,848 root_child DEBUG Command is 'ping'
00:41:30,848 root_child INFO pong

00:41:30,849 root_child INFO Waiting for command
00:41:30,849 packages.buskill DEBUG DEBUG: Response from root-child:|pong|

@maltfield
Copy link
Member

maltfield commented Jul 26, 2024

I disarmed buskill, then I kill -9ed the root_child process manually. Then I clicked the "arm" button again.

00:47:47,709 packages.buskill DEBUG DEBUG: attempting to disarm BusKill
00:47:47,714 packages.buskill INFO INFO: BusKill is disarmed.
00:47:52,444 packages.buskill DEBUG DEBUG: attempting to arm BusKill via <bound method BusKill.armNix of <packages.buskill.BusKill object at 0x10a386660>>() with the 'soft-shutdown' trigger
00:47:52,444 packages.buskill DEBUG DEBUG: Attempting to send 'ping' command to root child
00:47:52,446 packages.buskill DEBUG DEBUG: Response from root-child:||
00:47:52,447 packages.buskill ERROR ERROR: Unable to ping root child process

The app didn't arm (it stayed blue/disarmed), and I got an error message modal popup in the GUI that said

ERROR
Unable to toggle buskill state
ERROR: Unable to ping root child process

Success! This is important: the user is no longer given a false sense of security by telling them that the soft-shutdown trigger is "armed", if that's not the case. This, imho, is the most important outcome of this ticket.

@maltfield
Copy link
Member

Success! This is important: the user is no longer given a false sense of security by telling them that the soft-shutdown trigger is "armed", if that's not the case. This, imho, is the most important outcome of this ticket.

Ugh, I spoke too soon. It looks like there's another bug in our latest build that prevents the non-root-child-process (the one that listens to usb hotplug events) from executing

00:52:06,27 packages.buskill DEBUG DEBUG: Exception thrown in child process: Failed to load dynlib/dll 'libusb-1.0.dylib'. Most likely this dynlib/dll was not found when the application was frozen.

00:52:06,37 packages.buskill DEBUG DEBUG: Traceback: Traceback (most recent call last):
  File "PyInstaller/loader/pyimod03_ctypes.py", line 53, in __init__
  File "ctypes/__init__.py", line 379, in __init__
OSError: dlopen(libusb-1.0.dylib, 6): image not found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "buskill/__init__.py", line 1632, in run
    multiprocessing.Process.run(self)
  File "multiprocessing/process.py", line 108, in run
  File "buskill/__init__.py", line 1104, in armNix
    with usb1.USBContext() as context:
  File "usb1/__init__.py", line 2144, in __enter__
  File "usb1/__init__.py", line 2174, in open
  File "usb1/_libusb1.py", line 210, in loadLibrary
  File "usb1/_libusb1.py", line 219, in __loadLibrary
  File "usb1/_libusb1.py", line 158, in __getLibrary
  File "PyInstaller/loader/pyimod03_ctypes.py", line 55, in __init__
pyimod03_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll 'libusb-1.0.dylib'. Most likely this dynlib/dll was not found when the application was frozen.

Worst of all, the GUI app changes to red, and it says "Armed". It's definitely not armed.

Good news is that there is an OSError() exception thrown, so I should just have to wrap that multiprocessing.Process() call in a try: statement, and I can prevent this false-assurance the same way I did above.

@maltfield
Copy link
Member

maltfield commented Jul 27, 2024

Sigh, of course, in a GUI, this is more complicated than initially expected.

The non-root-child process (referenced as self.usb_handler) that sits in the background and monitors for usb hotplug events when armed doesn't propagate its exceptions up to the parent process. Even to learn about the exceptions, I had to write this hack that overloads the run() function of the multiprocessing.Process() object

In the example above, the parent is able to catch exceptions from the child, but only by wrapping a .join() in a try: statement -- which is, of course, blocking.

I could wait some amount of time after kicking-off the self.usb_handler child process (say, 1 second), and then check self.usb_handler._exception instance field that I use to catch & store any exceptions -- but then the UI would freeze during that time. Is it acceptable to make the user wait for 1 second before the app switches from blue/disarmed to red/armed?

Edit: probably a better option than spawn-wait-then-check-for-exception would be to make the usb_handler child (which is itself just an execution of self.ARM_FUNCTION) update some instance field of the process with either an "OK" message or, possibly better, an incrementing counter. That way I can just enter some (near-)infinite loop that checks this new keepalive_iter instance field and the _exception instance field. When one of them turns non-null, we'll exit the loop and either update the GUI as armed (if keepalive_iter is non-NULL) or throw and error and keep the GUI disarmed (if _exception is non-NULL)

Bonus: have some timeout. Eg if we've been looping for 1 second and both instance fields are non-NULL, exit the loop, display an error, and leave the app disarmed.

maltfield added a commit that referenced this issue Jul 27, 2024
This commit adds a 'status' instance field to the multiprocessing.Process() child process, which starts-out at 0 and gets incremented by the child process at some unknown interval (actually its updated by the parent by listening to a 'ping' command placed into the queue by the child).

This allows the parent to check-on the state of the child process after launching it, which is important because exceptions thrown by the child won't raise an exception up to the parent (we could catch it, but that would be blocking).

This allows us to detect if there's issues immediately after the user clicks the "arm" button. After this commit, we can prevent the app from giving the user a false sense of security, because we'll throw an error on toggle() if the child isn't well and the GUI will remain blue/disarmed rather than saying it's armed (even if it can't possibly trigger because the child process has issues)

 * #77 (comment)
@maltfield
Copy link
Member

all right, I implemented ^ this idea. I tested it, and it appears to be working fine on Linux

We added a new usb_handler.status instance field, which starts-out at 0. And I added a loop after kicking-off the non-root-child usb_handler process that loops infinitely until either usb_handler._exception is not None or usb_handler.status is > 0.

In the former case, we throw an error and the app stays disarmed/blue

In the later, we continue with updating the app armed/red

TODO test on macOS

@maltfield
Copy link
Member

well, the latest build just locks-up the GUI after pressing the "Arm" button. And I didn't even get my debug log prints from inside the while loop, so it looks like it never made it that far. I'll have to add some more debug prints to figure out where it's failing.

@maltfield
Copy link
Member

ok, I finally got the exception passing functional between the non-root child process and the main parent process's GUI.

Here's what we needed in the end:

@maltfield
Copy link
Member

Note: this issue is currently blocked by #87

I created a separate issue for resolving the OSError: dlopen(libusb-1.0.dylib, 6): image not found bug, which is currently preventing me from continuing with fixing this ticket's bug

@maltfield
Copy link
Member

maltfield commented Jul 28, 2024

Update: I fixed the OSError: dlopen(libusb-1.0.dylib, 6): image not found bug by bumping the libusb tarball from libusb-1.0.23 to libusb-1.0.27 in the MacOS build script

@maltfield
Copy link
Member

I think the only thing remaining in this ticket (before testing) is to have the root_child harden its own owner permissions on first execution

maltfield added a commit that referenced this issue Jul 28, 2024
This commit adds a step to the start of the root_child_mac binary to harden the root_child_mac binary. Basically it's self-hardening

The reason we do this is because (due to technical restrictions in .dmg files), we can't distribute a .dmg with a file that's owned by root. When the user first installs BusKill, the root_child_mac binary will be owned by their user.

This isn't the worst thing in the world, and we do allow spawning a root_child process as root if it's owned by the current user. But, it's safer if it's owned by root:root, so we harden it the first time it launches.

 * #77 (comment)
@maltfield
Copy link
Member

maltfield commented Jul 28, 2024

I attempted to update the root_child_mac.py script to harden its own permissions on-start (by doing a chown root:root /path/to/self, but curiously it doesn't know its own file?

23:13:27,297 root_child INFO Attempting to harden ourselves /Users/maltfield/Desktop
/buskill-1722132876.app/Contents/Frameworks/root_child_mac.py
23:13:27,297 root_child WARNING Failed to harden

So it's trying to set the permissions on /Contents/Frameworks/root_child_mac.py, which is literally a file that does not exist

bash-3.2$ ls -lah Desktop/buskill-1722132876.app/Contents/Frameworks/*.py
lrwxr-xr-x  1 maltfield  staff    27B Jul 28 03:18 Desktop/buskill-1722132876.app/Contents/Frameworks/buskill_cli.py -> ../Resources/buskill_cli.py
lrwxr-xr-x  1 maltfield  staff    27B Jul 28 03:18 Desktop/buskill-1722132876.app/Contents/Frameworks/buskill_gui.py -> ../Resources/buskill_gui.py
lrwxr-xr-x  1 maltfield  staff    31B Jul 28 03:18 Desktop/buskill-1722132876.app/Contents/Frameworks/buskill_version.py -> ../Resources/buskill_version.py
lrwxr-xr-x  1 maltfield  staff    20B Jul 28 03:18 Desktop/buskill-1722132876.app/Contents/Frameworks/main.py -> ../Resources/main.py
bash-3.2$ 
bash-3.2$ ls -lah Desktop/buskill-1722132876.app/Contents/Frameworks/root*
ls: Desktop/buskill-1722132876.app/Contents/Frameworks/root*: No such file or directory
bash-3.2$ 

The file that it needs to harden is actually a binary named root_child_mac

bash-3.2$ ls -lah Desktop/buskill-1722132876.app/Contents/MacOS/
total 16664
drwxr-xr-x  6 maltfield  staff   192B Jul 28 03:18 .
drwxr-xr-x  7 maltfield  staff   224B Jul 28 03:18 ..
-rwxr-xr-x  1 maltfield  staff   6.8M Jul 28 03:18 buskill
lrwxr-xr-x  1 maltfield  staff    18B Jul 28 03:18 fonts -> ../Resources/fonts
lrwxr-xr-x  1 maltfield  staff    19B Jul 28 03:18 images -> ../Resources/images
-r-x------  1 maltfield  staff   1.3M Jul 28 03:18 root_child_mac
bash-3.2$ 

bash-3.2$ file Desktop/buskill-1722132876.app/Contents/MacOS/root_child_mac 
Desktop/buskill-1722132876.app/Contents/MacOS/root_child_mac: Mach-O 64-bit executable x86_64
bash-3.2$ 

The binary is created by PyInstaller, and I guess it somehow doesn't realize where the new file will live after it's compiled to a binary. Hmm.

@maltfield
Copy link
Member

ok, I went though the list of answers to this SE question How do I get the path and name of the python file that is currently executing?, and the only one that appears to meet our needs is sys.executable

23:49:47,966 root_child INFO sys.path:|['/Users/maltfield/Desktop/buskill-1722206446.app/Contents/Frameworks/base_library.zip', '/Users/maltfield/Desktop/buskill-1722206446.app/Contents/Frameworks/lib-dynload', '/Users/maltfield/Desktop/buskill-1722206446.app/Contents/Frameworks']|
23:49:47,966 root_child INFO sys.argv:|['/Users/maltfield/Desktop/buskill-1722206446.app/Contents/MacOS/root_child_mac', '/var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/buskill.log']|
23:49:47,966 root_child INFO sys.executable:|/Users/maltfield/Desktop/buskill-1722206446.app/Contents/MacOS/root_child_mac|
23:49:47,966 root_child INFO sys.prefix:|/Users/maltfield/Desktop/buskill-1722206446.app/Contents/Frameworks|
23:49:47,967 root_child INFO os.environ:|environ({'USER': 'maltfield', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin:/Users/maltfield/Desktop/buskill-1722206446.app/Contents/MacOS:/Users/maltfield/Desktop/buskill-1722206446.app', 'LOGNAME': 'maltfield', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.OrpxIkyST8/Listeners', 'HOME': '/Users/maltfield', 'SHELL': '/bin/zsh', '__CF_USER_TEXT_ENCODING': '0x0:0:2', 'TMPDIR': '/var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/', 'XPC_SERVICE_NAME': '0', 'XPC_FLAGS': '0x0', 'KIVY_DATA_DIR': '/Users/maltfield/Desktop/buskill-1722206446.app/Contents/Frameworks/kivy_install/data', 'KIVY_MODULES_DIR': '/Users/maltfield/Desktop/buskill-1722206446.app/Contents/Frameworks/kivy_install/modules', 'GST_REGISTRY_FORK': 'no', 'GST_PLUGIN_PATH': '/Users/maltfield/Desktop/buskill-1722206446.app/Contents/Frameworks:/Users/maltfield/Desktop/buskill-1722206446.app/Contents/Frameworks/gst-plugins', 'GST_REGISTRY': '/Users/maltfield/Desktop/buskill-1722206446.app/Contents/Frameworks/registry.bin', 'GST_PLUGIN_SYSTEM_PATH': '', 'KIVY_HOME': '/Users/maltfield/Desktop/.buskill', '__AUTHORIZATION': 'auth 3', '_BASH_IMPLICIT_DASH_PEE': '-p'})|
23:49:47,967 root_child INFO os.getcwd():|/|
23:49:47,967 root_child INFO __file__:|/Users/maltfield/Desktop/buskill-1722206446.app/Contents/Frameworks/root_child_mac.py|
23:49:47,967 root_child INFO sys._getframe().f_code.co_filename:|buskill/root_child_mac.py|
23:49:47,967 root_child INFO inspect.getfile(inspect.currentframe()):|buskill/root_child_mac.py|
23:49:47,981 root_child INFO inspect.stack():|[FrameInfo(frame=<frame at 0x1027f1000, file 'buskill/root_child_mac.py', line 198, code <module>>, filename='/Users/maltfield/Desktop/buskill-1722206446.app/Contents/Frameworks/buskill/root_child_mac.pyc', lineno=198, function='<module>', code_context=None, index=None, positions=Positions(lineno=198, end_lineno=198, col_offset=31, end_col_offset=46))]|
23:49:47,982 root_child INFO inspect.getfile(inspect.currentframe()):|buskill/root_child_mac.py|
23:49:47,982 root_child INFO Attempting to harden ourselves /Users/maltfield/Desktop/buskill-1722206446.app/Contents/Frameworks/root_child_mac.py
23:49:47,982 root_child WARNING Failed to harden: [Errno 2] No such file or directory: '/Users/maltfield/Desktop/buskill-1722206446.app/Contents/Frameworks/root_child_mac.py'

@maltfield
Copy link
Member

maltfield commented Jul 28, 2024

Excellent. I just tested the latest build, and it's successfully able to harden the root_child_mac file

Here's the file's permissions after arming with the soft-shutdown script

bash-3.2$ ls -lah Desktop/buskill-
buskill-1722207354.app/ buskill-v0.6.0.app/     buskill-v0.7.0.app/
bash-3.2$ ls -lah Desktop/buskill-1722207354.app/Contents/MacOS/
total 16664
drwxr-xr-x  6 maltfield  staff   192B Jul 28 23:59 .
drwxr-xr-x  7 maltfield  staff   224B Jul 28 23:59 ..
-rwxr-xr-x  1 maltfield  staff   6.8M Jul 28 23:59 buskill
lrwxr-xr-x  1 maltfield  staff    18B Jul 28 23:59 fonts -> ../Resources/fonts
lrwxr-xr-x  1 maltfield  staff    19B Jul 28 23:59 images -> ../Resources/images
-r-x------  1 root       wheel   1.3M Jul 28 23:59 root_child_mac
bash-3.2$ 

bash-3.2$ ls -lahn Desktop/buskill-1722207354.app/Contents/MacOS/
total 16664
drwxr-xr-x  6 502  20   192B Jul 28 23:59 .
drwxr-xr-x  7 502  20   224B Jul 28 23:59 ..
-rwxr-xr-x  1 502  20   6.8M Jul 28 23:59 buskill
lrwxr-xr-x  1 502  20    18B Jul 28 23:59 fonts -> ../Resources/fonts
lrwxr-xr-x  1 502  20    19B Jul 28 23:59 images -> ../Resources/images
-r-x------  1 0    0    1.3M Jul 28 23:59 root_child_mac
bash-3.2$ 

@maltfield
Copy link
Member

ok, I think we've implemented all the TODO items above, but I have one more item:

  1. Fix on-launch trigger

I've found that, when you first launch the BusKill app, if you click "arm" then it always arms with the 'lock-screen' trigger, even if the user set the tirgger to 'soft-shutdown'. Even when you go into Settings, 'soft-shudown' is shown as the current trigger, but you have to change it back to 'lock-screen' and then return it back to 'soft-shudown' before the app will arm it with the proper trigger

maltfield added a commit that referenced this issue Jul 29, 2024
This commit replaces the Config item name "buskill" with "buskill_trigger"

Apparently I silently renamed this option in the Config file some months ago when I was switching the Settings screen to use RecycleView, for the font accessibility feature

 * #55 (comment)

I don't know exactly why I made the change, but apparently I already updated it in other places, except here. The result: a bug where the first time you "arm" BusKill, it always defaulted to the 'lock-screen' trigger, instead of the setting the user already set it to.

 * #77 (comment)
@maltfield
Copy link
Member

I tested the latest build, and I confirmed that it arms with 'soft-shutdown' on first try after launching if 'soft-shutdown' was defined as the buskill_trigger in the config file

@maltfield
Copy link
Member

I believe that addresses all of the issues

@samxplogs can you please download & install the latest prerelease build and test to see if you can reproduce this issue where soft shutdown does not work (or any other errors)?

@maltfield
Copy link
Member

This is currently blocked by #91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants