Merge pull request #618 from ayhanyalcinsoy/master
dhcpcd:added service.py
This commit is contained in:
@@ -10,20 +10,22 @@ from pisi.actionsapi import get
|
|||||||
from pisi.actionsapi import shelltools
|
from pisi.actionsapi import shelltools
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
autotools.configure("--libexecdir=/lib/dhcpcd \
|
autotools.configure("--libexecdir=/usr/lib/dhcpcd \
|
||||||
--dbdir=/var/lib/dhcpcd \
|
--dbdir=/var/lib/dhcpcd \
|
||||||
--localstatedir=/var \
|
--localstatedir=/var \
|
||||||
|
--sbindir=/usr/bin \
|
||||||
--rundir=/run")
|
--rundir=/run")
|
||||||
|
|
||||||
def build():
|
def build():
|
||||||
autotools.make()
|
autotools.make()
|
||||||
|
|
||||||
def install():
|
def install():
|
||||||
autotools.rawInstall("DBDIR=/var/lib/dhcpcd LIBEXECDIR=/lib/dhcpcd DESTDIR=%s" % get.installDIR())
|
autotools.rawInstall("DESTDIR=%s" % get.installDIR())
|
||||||
# Set Options in /etc/dhcpcd.conf Disable ip4vall
|
# Set Options in /etc/dhcpcd.conf Disable ip4vall
|
||||||
shelltools.echo("%s/etc/dhcpcd.conf" % get.installDIR(), "noipv4ll")
|
shelltools.echo("%s/etc/dhcpcd.conf" % get.installDIR(), "noipv4ll")
|
||||||
# Remove hooks install the compat one
|
# Remove hooks install the compat one
|
||||||
pisitools.remove("/lib/dhcpcd/dhcpcd-hooks/*")
|
pisitools.remove("/usr/lib/dhcpcd/dhcpcd-hooks/*")
|
||||||
pisitools.insinto("/lib/dhcpcd/dhcpcd-hooks", "dhcpcd-hooks/50-dhcpcd-compat")
|
pisitools.insinto("/usr/lib/dhcpcd/dhcpcd-hooks", "dhcpcd-hooks/50-dhcpcd-compat")
|
||||||
|
|
||||||
pisitools.dodoc("README")
|
pisitools.dodoc("README")
|
||||||
|
#DBDIR=/var/lib/dhcpcd LIBEXECDIR=/usr/lib/dhcpcd
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from comar.service import *
|
||||||
|
import os
|
||||||
|
|
||||||
|
serviceType = "local"
|
||||||
|
serviceDefault = "conditional"
|
||||||
|
serviceDesc = _({"en": "Dhcp client",
|
||||||
|
"tr": "Dhcp istemcisi"})
|
||||||
|
|
||||||
|
MSG_BACKEND_WARNING = _({
|
||||||
|
"en" : "dhcp is not enabled by default. You can change this from /etc/dhcpcd.conf.",
|
||||||
|
"tr" : "dhcp öntanımlı olarak etkin değil. /etc/dhcpcd.conf dosyasından bu ayarı değiştirebilirsiniz."
|
||||||
|
})
|
||||||
|
|
||||||
|
pidfile="/var/run/dhcpcd.pid"
|
||||||
|
USETHIS=eval(config.get("DEFAULT", "True"))
|
||||||
|
|
||||||
|
@synchronized
|
||||||
|
def start():
|
||||||
|
if not USETHIS:
|
||||||
|
fail(MSG_BACKEND_WARNING)
|
||||||
|
|
||||||
|
startService(command="/usr/bin/dhcpcd",
|
||||||
|
args="daemon -q -b %s" % pidfile,
|
||||||
|
donotify=True)
|
||||||
|
|
||||||
|
@synchronized
|
||||||
|
def stop():
|
||||||
|
stopService(command="/usr/bin/dhcpcd -x",
|
||||||
|
donotify=True)
|
||||||
|
|
||||||
|
try:
|
||||||
|
os.unlink(pidfile)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def ready():
|
||||||
|
if not USETHIS:
|
||||||
|
fail(MSG_BACKEND_WARNING)
|
||||||
|
else:
|
||||||
|
start()
|
||||||
|
|
||||||
|
def status():
|
||||||
|
return isServiceRunning(pidfile=pidfile)
|
||||||
@@ -26,18 +26,22 @@
|
|||||||
<Files>
|
<Files>
|
||||||
<Path fileType="config">/etc</Path>
|
<Path fileType="config">/etc</Path>
|
||||||
<Path fileType="data">/lib/dhcpcd</Path>
|
<Path fileType="data">/lib/dhcpcd</Path>
|
||||||
<Path fileType="library">/usr/lib/dhcpcd/dev/udev.so</Path>
|
<Path fileType="library">/usr/lib/dhcpcd</Path>
|
||||||
<Path fileType="executable">/usr/sbin</Path>
|
<Path fileType="executable">/usr/bin</Path>
|
||||||
<Path fileType="doc">/usr/share/doc</Path>
|
<Path fileType="doc">/usr/share/doc</Path>
|
||||||
<Path fileType="man">/usr/share/man</Path>
|
<Path fileType="man">/usr/share/man</Path>
|
||||||
<Path fileType="man">/usr/share/dhcpcd</Path>
|
<Path fileType="man">/usr/share/dhcpcd</Path>
|
||||||
<Path fileType="data">/var/lib/dhcpcd</Path>
|
<Path fileType="data">/var/lib/dhcpcd</Path>
|
||||||
|
<Path fileType="data">/run/dhcp</Path>
|
||||||
</Files>
|
</Files>
|
||||||
|
<Provides>
|
||||||
|
<COMAR script="service.py">System.Service</COMAR>
|
||||||
|
</Provides>
|
||||||
</Package>
|
</Package>
|
||||||
|
|
||||||
<History>
|
<History>
|
||||||
<Update release="3">
|
<Update release="3">
|
||||||
<Date>2017-02-21</Date>
|
<Date>2017-02-23</Date>
|
||||||
<Version>6.11.5</Version>
|
<Version>6.11.5</Version>
|
||||||
<Comment>Version bump.</Comment>
|
<Comment>Version bump.</Comment>
|
||||||
<Name>Ertuğrul Erata</Name>
|
<Name>Ertuğrul Erata</Name>
|
||||||
|
|||||||
Reference in New Issue
Block a user