music player daemon.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
|
||||
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
|
||||
for d in ["/var/lib/mpd", "/var/lib/mpd/.mpd", "/var/lib/mpd/.mpd/playlists", "/var/lib/mpd/.mpd/music"]:
|
||||
if not os.path.exists(d):
|
||||
os.mkdir(d)
|
||||
# $ id nobody
|
||||
# uid=250(mpd) gid=18(audio)
|
||||
os.chown(d, 250, 18)
|
||||
os.chmod(d, 0750)
|
||||
|
||||
os.system("/sbin/mudur_tmpfiles.py /usr/lib/tmpfiles.d/mpd.conf")
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
serviceType = "server"
|
||||
serviceDesc = \
|
||||
\
|
||||
_({"en": "Music Player Daemon",
|
||||
"tr": "Müzik Çalıcı Sunucusu"})
|
||||
|
||||
from comar.service import *
|
||||
import re
|
||||
import os
|
||||
|
||||
PIDFILE = "/run/mpd/mpd.pid"
|
||||
|
||||
@synchronized
|
||||
def start():
|
||||
startService(command="/usr/bin/mpd",
|
||||
args="/etc/mpd.conf",
|
||||
pidfile=PIDFILE,
|
||||
donotify=True)
|
||||
|
||||
@synchronized
|
||||
def stop():
|
||||
stopService(PIDFILE,
|
||||
donotify=True)
|
||||
|
||||
def status():
|
||||
return isServiceRunning(PIDFILE)
|
||||
Reference in New Issue
Block a user