system-image can't open its log file if not run as root

Bug #1301995 reported by Barry Warsaw
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu system image
Fix Released
High
Barry Warsaw

Bug Description

This mostly affects testing since in normal operation, s-i-dbus *is* run as root. The testing infrastructure sees crashes like this often, so it would be good to try to fix this.

PythonArgs: ['/usr/sbin/system-image-dbus']
Traceback:
 Traceback (most recent call last):
   File "/usr/sbin/system-image-dbus", line 9, in <module>
     load_entry_point('system-image==2.2', 'console_scripts', 'system-image-dbus')()
   File "/usr/lib/python3/dist-packages/systemimage/service.py", line 91, in main
     initialize(verbosity=args.verbose)
   File "/usr/lib/python3/dist-packages/systemimage/logging.py", line 86, in initialize
     with open(config.system.logfile, 'a', encoding='utf-8'):
 PermissionError: [Errno 13] Permission denied: '/var/log/system-image/client.log'
UserGroups: adm autopilot cdrom dialout dip nopasswdlogin plugdev sudo tty video
_LogindSession: /user/0.user/c1.session

Some users have also tried to run `system-image-cli --info` as non-root and get a similar crash.

Tags: client

Related branches

Revision history for this message
Barry Warsaw (barry) wrote :

Probably the thing to do is when not run as root, log to ~/.local/system-image/log/client.log

Changed in ubuntu-system-image:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Barry Warsaw (barry)
milestone: none → 2.3
Barry Warsaw (barry)
Changed in ubuntu-system-image:
status: Triaged → In Progress
Revision history for this message
Barry Warsaw (barry) wrote :

Or ~/.cache/system-image/log/client.log

Barry Warsaw (barry)
Changed in ubuntu-system-image:
status: In Progress → Fix Committed
Barry Warsaw (barry)
Changed in ubuntu-system-image:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.