Slimbook-Team / slimbookbattery

Slimbook Battery 4
https://slimbook.es/en/tutoriales/aplicaciones-slimbook/398-slimbook-battery-3-application-for-optimize-battery-of-your-laptop
GNU General Public License v3.0
239 stars 17 forks source link

Slimbook Battery does not launch in multi-user environment. #132

Open FlaanKatsu opened 2 weeks ago

FlaanKatsu commented 2 weeks ago

Describe the bug When attempting to launch Slimbook Battery from a different user than who installed it, Slimbook Battery does not launch. For example, if user A installs slimbook battery and runs it, then user A logs off, user B logs on, and attempts to run slimbook battery, it does not launch. Slimbook Battery only launches from user A.

To Reproduce Attempt to launch Slimbook Battery from any user other than the one that installed it. Attempting to run from the terminal yields the following error:

Cannot open log file /var/slimbookbattery.log, using /tmp/slimbookbattery.log
Traceback (most recent call last):
  File "/usr/share/slimbookbattery/src/utils.py", line 21, in get_logger
    fh = logging.FileHandler("/var/log/slimbookbattery.log")
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/__init__.py", line 1231, in __init__
    StreamHandler.__init__(self, self._open())
                                 ^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/__init__.py", line 1263, in _open
    return open_func(self.baseFilename, self.mode,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/var/log/slimbookbattery.log'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/slimbookbattery/src/slimbookbatterypreferences.py", line 37, in <module>
    import utils
  File "/usr/share/slimbookbattery/src/utils.py", line 40, in <module>
    logger = get_logger("utils.py", True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/slimbookbattery/src/utils.py", line 25, in get_logger
    fh = logging.FileHandler("/tmp/slimbookbattery.log")
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/__init__.py", line 1231, in __init__
    StreamHandler.__init__(self, self._open())
                                 ^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/__init__.py", line 1263, in _open
    return open_func(self.baseFilename, self.mode,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/tmp/slimbookbattery.log'

Desktop (please complete the following information):

Expected behavior (Optional) Slimbook battery to launch for users other than the user that installed it.

Screenshots N/A

Additional context N/A

FlaanKatsu commented 2 weeks ago

edit: added date to "updated to latest packages" for clarity