Bug 8246 - AppArmor setup traceback if systemctl is missing
Summary: AppArmor setup traceback if systemctl is missing
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Server Installer (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Bugzilla mail exporter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-27 09:35 CEST by Pierre Ossman
Modified: 2023-10-31 13:20 CET (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2023-10-27 09:35:45 CEST
If you try to install ThinLinc on a system with AppArmor, but without systemd (or at least without systemctl), you get this crash in tl-setup:

> 2023-10-26 14:59:46,004: Configuring AppArmor...
> 2023-10-26 14:59:46,009: Traceback (most recent call last):
> 2023-10-26 14:59:46,009:   File "/opt/thinlinc/modules/thinlinc/tlsetup/apparmor.py", line 48, in Ii111
> 2023-10-26 14:59:46,010:     oO = subprocess . Popen ( [ '/bin/systemctl' , 'reload' , 'apparmor' ] ,
> 2023-10-26 14:59:46,010:          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 2023-10-26 14:59:46,010:   File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
> 2023-10-26 14:59:46,010:     self._execute_child(args, executable, preexec_fn, close_fds,
> 2023-10-26 14:59:46,010:   File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
> 2023-10-26 14:59:46,010:     raise child_exception_type(errno_num, err_msg, err_filename)
> 2023-10-26 14:59:46,010: FileNotFoundError: [Errno 2] No such file or directory: '/bin/systemctl'
> 2023-10-26 14:59:46,010: 
> 2023-10-26 14:59:46,010: During handling of the above exception, another exception occurred:
> 2023-10-26 14:59:46,010: 
> 2023-10-26 14:59:46,010: Traceback (most recent call last):
> 2023-10-26 14:59:46,010:   File "/opt/thinlinc/sbin/../libexec/tl-setup.py", line 319, in <module>
> 2023-10-26 14:59:46,010:     oOoO00 ( )
> 2023-10-26 14:59:46,010:   File "/opt/thinlinc/sbin/../libexec/tl-setup.py", line 275, in oOoO00
> 2023-10-26 14:59:46,010:     IiiI1III1iI = Iioo0Oo0oO0 . run ( )
> 2023-10-26 14:59:46,010:                   ^^^^^^^^^^^^^^^^^^^^^
> 2023-10-26 14:59:46,010:   File "/opt/thinlinc/modules/thinlinc/wizard.py", line 110, in run
> 2023-10-26 14:59:46,010:     return self . _run_text ( )
> 2023-10-26 14:59:46,010:            ^^^^^^^^^^^^^^^^^^^^
> 2023-10-26 14:59:46,010:   File "/opt/thinlinc/modules/thinlinc/wizard.py", line 128, in _run_text
> 2023-10-26 14:59:46,010:     iI1iI ( )
> 2023-10-26 14:59:46,010:   File "/opt/thinlinc/modules/thinlinc/tlsetup/apparmor.py", line 127, in iiI1111II
> 2023-10-26 14:59:46,010:     if not Ii111 ( ) :
> 2023-10-26 14:59:46,011:            ^^^^^^^^^
> 2023-10-26 14:59:46,011:   File "/opt/thinlinc/modules/thinlinc/tlsetup/apparmor.py", line 53, in Ii111
> 2023-10-26 14:59:46,011:     logging . info ( "Cannot reload apparmor service: %s" % ( cmd , I111IIi11IiI ) )
> 2023-10-26 14:59:46,011:                                                               ^^^
> 2023-10-26 14:59:46,011: NameError: name 'cmd' is not defined
Comment 2 Pierre Ossman cendio 2023-10-27 09:36:52 CEST
It looks like we are trying to handle this, but there is a bug in the code catching the exception.

Note You need to log in before you can comment on or make changes to this bug.