Added lightdm

This commit is contained in:
Berk Çakar
2021-04-26 18:37:08 +03:00
parent 0466214b3c
commit 06758491f7
16 changed files with 523 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
#!/usr/bin/python
import os, re
OUR_ID = 620
OUR_NAME = "lightdm"
OUR_DESC = "LightDM"
Cache = "/var/cache/lightdm"
Libdir = "/var/lib/lightdm-data"
Libdir1 = "/var/lib/lightdm"
Logdir = "/var/log/lightdm"
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
try:
os.system ("groupadd -g %d %s" % (OUR_ID, OUR_NAME))
os.system ("useradd -m -d /var/lib/lightdm -r -s /bin/false -u %d -g %d %s -c %s" % (OUR_ID, OUR_ID, OUR_NAME, OUR_DESC))
except:
pass
if not os.path.exists(Cache):
os.makedirs(Cache, mode=0755)
if not os.path.exists(Libdir):
os.makedirs(Libdir, mode=0770)
os.system("chown -R lightdm:lightdm /var/lib/lightdm-data")
if not os.path.exists(Libdir1):
os.makedirs(Libdir1, mode=0770)
os.system("chown -R lightdm:lightdm /var/lib/lightdm")
if not os.path.exists(Logdir):
os.makedirs(Logdir, mode=0711)
os.system("/bin/chgrp -R lightdm /var/log/lightdm")
os.system("chmod +t /var/{cache/lightdm,lib/lightdm{,-data}}")
def postRemove():
try:
os.system ("userdel %s" % OUR_NAME)
os.system ("groupdel %s" % OUR_NAME)
except:
pass
+32
View File
@@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
from comar.service import *
import os
serviceType="server"
serviceDesc=_({"en": "lightdm Server",
"tr": "lightdm Sunucusu"})
serviceDefault="on"
PIDFILE="/run/lightdm.pid"
DAEMON="/usr/bin/lightdm"
@synchronized
def start():
startService(command=DAEMON,
pidfile=PIDFILE,
detach=True,
donotify=True)
@synchronized
def stop():
stopService(pidfile=PIDFILE,
donotify=True)
try:
os.unlink(PIDFILE)
except OSError:
pass
def status():
return isServiceRunning(PIDFILE)