Merhabalar,
Pardus işletim sistemi üzerinde manuel olarak python kurulumu yapıldıktan sonra lightdm servisi başlatılamıyor. Bunun sebebi pardus araçları içerisinde import edilen “gi” kütüphanesinin varsayılan olarak python kurulumunda yer almaması.
Hata ile ilgili loglar ve hatanın izlediği yol;
Lightdm log çıktısı
mustafa@pardus:~$ sudo cat /var/log/lightdm/lightdm.log
[+0.00s] DEBUG: Logging to /var/log/lightdm/lightdm.log
[+0.00s] DEBUG: Starting Light Display Manager 1.26.0, UID=0 PID=1987
[+0.00s] DEBUG: Loading configuration dirs from /usr/share/lightdm/lightdm.conf.d
[+0.00s] DEBUG: Loading configuration from /usr/share/lightdm/lightdm.conf.d/01_debian.conf
[+0.00s] DEBUG: Loading configuration from /usr/share/lightdm/lightdm.conf.d/49-pardus-numlock.conf
[+0.00s] DEBUG: Loading configuration from /usr/share/lightdm/lightdm.conf.d/50-pardus-xfce.conf
[+0.00s] DEBUG: Loading configuration from /usr/share/lightdm/lightdm.conf.d/99-pardus.conf
[+0.00s] DEBUG: Loading configuration dirs from /usr/local/share/lightdm/lightdm.conf.d
[+0.00s] DEBUG: Loading configuration dirs from /etc/xdg/lightdm/lightdm.conf.d
[+0.00s] DEBUG: Loading configuration from /etc/lightdm/lightdm.conf
[+0.00s] DEBUG: Registered seat module local
[+0.00s] DEBUG: Registered seat module xremote
[+0.00s] DEBUG: Registered seat module unity
[+0.00s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager
[+0.00s] DEBUG: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ‘gio-vfs’
[+0.00s] DEBUG: Monitoring logind for seats
[+0.00s] DEBUG: New seat added from logind: seat0
[+0.00s] DEBUG: Seat seat0: Loading properties from config section Seat:*
[+0.00s] DEBUG: Seat seat0 has property CanMultiSession=no
[+0.00s] DEBUG: Seat seat0: Starting
[+0.00s] DEBUG: Seat seat0: Creating greeter session
[+0.00s] DEBUG: Seat seat0: Creating display server of type x
[+0.01s] DEBUG: Using VT 7
[+0.01s] DEBUG: Seat seat0: Starting local X display on VT 7
[+0.01s] DEBUG: XServer 0: Logging to /var/log/lightdm/x-0.log
[+0.01s] DEBUG: XServer 0: Writing X server authority to /var/run/lightdm/root/:0
[+0.01s] DEBUG: XServer 0: Launching X Server
[+0.01s] DEBUG: Launching process 1993: /usr/bin/X :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
[+0.01s] DEBUG: XServer 0: Waiting for ready signal from X server :0
[+0.01s] DEBUG: Acquired bus name org.freedesktop.DisplayManager
[+0.01s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0
[+0.01s] DEBUG: Loading users from org.freedesktop.Accounts
[+0.01s] DEBUG: User /org/freedesktop/Accounts/User1000 added
[+0.72s] DEBUG: Got signal 10 from process 1993
[+0.72s] DEBUG: XServer 0: Got signal from X server :0
[+0.72s] DEBUG: XServer 0: Connecting to XServer :0
[+0.72s] DEBUG: Seat seat0: Display server ready, starting session authentication
[+0.72s] DEBUG: Session pid=2002: Started with service ‘lightdm-greeter’, username ‘lightdm’
[+0.73s] DEBUG: Session pid=2002: Authentication complete with return value 0: Success
[+0.73s] DEBUG: Seat seat0: Session authenticated, running command
[+0.73s] DEBUG: Launching process 2005: pardus-numlockx
[+0.74s] DEBUG: Process 2005 exited with return value 0
[+0.74s] DEBUG: Seat seat0: Exit status of pardus-numlockx: 0
[+0.74s] DEBUG: Session pid=2002: Running command /usr/libexec/pardus-lightdm-greeter
[+0.74s] DEBUG: Creating shared data directory /var/lib/lightdm/data/lightdm
[+0.74s] DEBUG: Session pid=2002: Logging to /var/log/lightdm/seat0-greeter.log
[+0.79s] DEBUG: Activating VT 7
[+0.79s] DEBUG: Activating login1 session c5
[+0.79s] DEBUG: Seat seat0 changes active session to c5
[+0.79s] DEBUG: Session c5 is already active
[+0.85s] DEBUG: Greeter closed communication channel
[+0.85s] DEBUG: Session pid=2002: Exited with return value 1
[+0.85s] DEBUG: Seat seat0: Session stopped
[+0.85s] DEBUG: Seat seat0: Stopping; failed to start a greeter
[+0.85s] DEBUG: Seat seat0: Stopping
[+0.85s] DEBUG: Seat seat0: Stopping display server
[+0.85s] DEBUG: Sending signal 15 to process 1993
[+0.86s] DEBUG: Seat seat0 changes active session to
[+1.34s] DEBUG: Process 1993 exited with return value 0
[+1.34s] DEBUG: XServer 0: X server stopped
[+1.34s] DEBUG: Releasing VT 7
[+1.34s] DEBUG: XServer 0: Removing X server authority /var/run/lightdm/root/:0
[+1.34s] DEBUG: Seat seat0: Display server stopped
[+1.34s] DEBUG: Seat seat0: Stopped
[+1.34s] DEBUG: Required seat has stopped
[+1.34s] DEBUG: Stopping display manager
[+1.34s] DEBUG: Display manager stopped
[+1.34s] DEBUG: Stopping daemon
[+1.34s] DEBUG: Exiting with return value 1
Loglarda yer aldığı şekilde /usr/libexec/pardus-lightdm-greeter scripti ile main.py programı çağrılıyor;
#!/bin/bash
exec python3 /usr/share/pardus/pardus-lightdm-greeter/main.py 1>&2
main.py dosyasındaki ilgili satırlar;
40 os.system(get(“init”,“”))
41
42 import gi
43 gi.require_version(‘Gtk’, ‘3.0’)
44 from gi.repository import Gtk, Gdk, GLib, GdkPixbuf
Hataya ilişkin log kayıtları;
mustafa@pardus:~$sudo cat /var/log/lightdm/seat0-greeter.log
non-network local connections being added to access control list
Traceback (most recent call last):
File “/usr/share/pardus/pardus-lightdm-greeter/main.py”, line 42, in
import gi
ModuleNotFoundError: No module named ‘gi’
Çözüm için yapılması gereken; manuel olarak python kurulumu yapıldıktan sonra “gi” kütüphanesini sisteme eklemek. Öncelikle ilgili paketler aşağıdaki komu ile kurulmalı;
sudo apt install libcairo2-dev libxt-dev libgirepository1.0-dev
Sonrasında sistemde varsayılan Python sürümü kontrol edilmeli;
mustafa@pardus:~$ python3 --version
Python 3.11.3
Sistem Python3.11 kullandığı için pip3.11 komutu ile “pycairo” ve “PyGObject” paketleri yüklenmelidir.
sudo pip3.11 install pycairo PyGObject
Hatanın düzeldiğini test etmek için;
mustafa@pardus:~$ sudo python3
[sudo] password for mustafa:
Python 3.11.3 (main, Apr 21 2023, 23:20:07) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>>
>>> quit()
mustafa@pardus:~$
import gi
komutu herhangi bir hata döndürmediyse işlem tamamlanmış olmaktadır.
Bu hata ile ilgili olarak Pardus geliştiricilerinden ufak bir ricam olacak; sistem temel fonksiyonlarını etkileyecek bu tarz durumlarda doğrudan kütüphane import etmek yerine “try-except” veya alternatif yollar ile kütüphane varlığı kontrol edilmelidir. Ek özellik ekleyelim derken çekirdek fonksiyonları kaybetmek hoş olmuyor bu lightdm servisini sonlandıran hata epey vaktimi aldı o yüzden detayları paylaşmak istedim.
Herkese teşekkürler,
iyi çalışmalar.