move sddm

This commit is contained in:
groni
2016-10-25 10:16:05 +02:00
parent 6732f8dcb7
commit 5f7a208f08
21 changed files with 108 additions and 108 deletions
+46
View File
@@ -0,0 +1,46 @@
#!/usr/bin/python
import os, re
import shutil
OUR_ID = 65
OUR_NAME = "sddm"
OUR_DESC = "sddm"
DATADIR = "/var/lib/sddm"
DATADIRMODE = 0755
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
# On first install...
if not os.path.exists(DATADIR):
os.makedirs(DATADIR, DATADIRMODE)
try:
os.system ("groupadd -g %d %s" % (OUR_ID, OUR_NAME))
os.system ("useradd -m -d /var/lib/sddm -r -s /bin/false -u %d -g %d %s -c %s" % (OUR_ID, OUR_ID, OUR_NAME, OUR_DESC))
os.system ("passwd -l sddm > /dev/null")
os.system("/bin/chown -R sddm:sddm %s" % DATADIR)
except:
pass
# os.system ("groupadd --system %s" % (OUR_NAME))
# os.system ("useradd -c 'sddm' --system -d /var/lib/sddm -s /sbin/nologin -g %s %s" % (OUR_NAME, OUR_DESC))
# os.system("/bin/chown -R sddm:sddm /var/log/sddm.log")
def postRemove():
try:
os.system ("userdel %s" % OUR_NAME)
os.system ("groupdel %s" % OUR_NAME)
except:
pass
+31
View File
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
from comar.service import *
import os
serviceType="server"
serviceDesc=_({"en": "sddm Server",
"tr": "sddm Sunucusu"})
serviceDefault="on"
PIDFILE="/run/sddm/sddm.pid"
DAEMON="/usr/bin/sddm"
@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)