create core package
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
Index: api/comar/service.py
|
||||
===================================================================
|
||||
--- api/comar/service.py (revision 33513)
|
||||
+++ api/comar/service.py (revision 33514)
|
||||
@@ -113,6 +113,18 @@
|
||||
except:
|
||||
pass
|
||||
|
||||
+def stopDependencies(*services):
|
||||
+ """Stop dependencies.
|
||||
+
|
||||
+ Arguments are service names.
|
||||
+ """
|
||||
+ for service in services:
|
||||
+ try:
|
||||
+ call(service, "System.Service", "stop")
|
||||
+ except:
|
||||
+ pass
|
||||
+
|
||||
+
|
||||
# Service control utilities
|
||||
|
||||
def _getPid(pidfile):
|
||||
@@ -0,0 +1,30 @@
|
||||
diff -Naur comar-api-2.4.9.orig/comar/network.py comar-api-2.4.9/comar/network.py
|
||||
--- comar-api-2.4.9.orig/comar/network.py 2014-08-19 20:10:23.926869379 +0200
|
||||
+++ comar-api-2.4.9/comar/network.py 2014-08-19 20:11:42.129866522 +0200
|
||||
@@ -15,8 +15,8 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
-from pardus import iniutils
|
||||
-from pardus import netutils
|
||||
+from pisilinux import iniutils
|
||||
+from pisilinux import netutils
|
||||
|
||||
from comar.service import startService, stopService, loadConfig
|
||||
|
||||
diff -Naur comar-api-2.4.9.orig/setup.py comar-api-2.4.9/setup.py
|
||||
--- comar-api-2.4.9.orig/setup.py 2010-11-11 14:29:05.000000000 +0100
|
||||
+++ comar-api-2.4.9/setup.py 2014-08-19 20:12:26.807864889 +0200
|
||||
@@ -50,9 +50,9 @@
|
||||
class Install(install):
|
||||
def finalize_options(self):
|
||||
# NOTE: for Pardus distribution
|
||||
- if os.path.exists("/etc/pardus-release"):
|
||||
- self.install_platlib = '$base/lib/pardus'
|
||||
- self.install_purelib = '$base/lib/pardus'
|
||||
+ if os.path.exists("/etc/pisilinux-release"):
|
||||
+ self.install_platlib = '$base/lib/pisilinux'
|
||||
+ self.install_purelib = '$base/lib/pisilinux'
|
||||
install.finalize_options(self)
|
||||
|
||||
def run(self):
|
||||
@@ -0,0 +1,30 @@
|
||||
diff -Naur comar-api-2.4.9.orig/comar/network.py comar-api-2.4.9/comar/network.py
|
||||
--- comar-api-2.4.9.orig/comar/network.py 2010-11-11 14:29:05.000000000 +0100
|
||||
+++ comar-api-2.4.9/comar/network.py 2014-08-19 20:06:27.584878014 +0200
|
||||
@@ -146,12 +146,12 @@
|
||||
# Start service
|
||||
startService(command="/usr/sbin/ifplugd",
|
||||
args="%s -i %s" % (args, device),
|
||||
- pidfile="/var/run/ifplugd.%s.pid" % device,
|
||||
+ pidfile="/run/ifplugd.%s.pid" % device,
|
||||
detach=True,
|
||||
donotify=False)
|
||||
else:
|
||||
# Stop service
|
||||
- stopService(pidfile="/var/run/ifplugd.%s.pid" % device, donotify=False)
|
||||
+ stopService(pidfile="/run/ifplugd.%s.pid" % device, donotify=False)
|
||||
|
||||
def plugCheck(device):
|
||||
# Return true if ifplugd is missing
|
||||
diff -Naur comar-api-2.4.9.orig/comar/utility.py comar-api-2.4.9/comar/utility.py
|
||||
--- comar-api-2.4.9.orig/comar/utility.py 2010-11-11 14:29:05.000000000 +0100
|
||||
+++ comar-api-2.4.9/comar/utility.py 2014-08-19 20:06:52.055877120 +0200
|
||||
@@ -31,7 +31,7 @@
|
||||
"""
|
||||
class Handler:
|
||||
def handler(self, *args, **kwargs):
|
||||
- lock = FileLock("/var/lock/subsys/%s.comar" % script())
|
||||
+ lock = FileLock("/run/lock/subsys/%s.comar" % script())
|
||||
lock.lock()
|
||||
self.myfunc(*args, **kwargs)
|
||||
lock.unlock()
|
||||
Reference in New Issue
Block a user