clamav-1.4.2
This commit is contained in:
@@ -1,24 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
from comar.service import *
|
||||
|
||||
serviceType = "server"
|
||||
serviceType = "local"
|
||||
serviceDefault = "off"
|
||||
serviceConf = "clamd"
|
||||
serviceDesc = _({"en": "Clam Anti-Virus Daemon",
|
||||
"tr": "Clam Antivirüs Servisi"})
|
||||
|
||||
PIDFILE = "/var/run/clamd.pid"
|
||||
|
||||
@synchronized
|
||||
def start():
|
||||
startService(command="/usr/sbin/clamd",
|
||||
pidfile="/run/clamd.pid",
|
||||
donotify=False)
|
||||
time.sleep(4)
|
||||
args="--config-file=/etc/clamav/clamd.conf %s" % config.get("CLIOPTS"),
|
||||
pidfile=PIDFILE,
|
||||
detach=True,
|
||||
donotify=True)
|
||||
|
||||
@synchronized
|
||||
def stop():
|
||||
stopService(command="/usr/sbin/clamd",
|
||||
pidfile=PIDFILE,
|
||||
donotify=True)
|
||||
if os.path.isfile(PIDFILE): os.unlink(PIDFILE)
|
||||
|
||||
def status():
|
||||
return isServiceRunning("/run/clamd.pid")
|
||||
return isServiceRunning(PIDFILE)
|
||||
|
||||
@@ -1,23 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
from comar.service import *
|
||||
|
||||
serviceType = "server"
|
||||
serviceType = "local"
|
||||
serviceDefault = "off"
|
||||
serviceConf = "freshclam"
|
||||
serviceDesc = _({"en": "ClamAV database updater service"})
|
||||
|
||||
PIDFILE = "/var/run/freshclam.pid"
|
||||
|
||||
@synchronized
|
||||
def start():
|
||||
startService(command="/usr/bin/freshclam",
|
||||
args="-d -p /run/freshclam.pid",
|
||||
pidfile="/run/freshclam.pid",
|
||||
args="--config-file=/etc/clamav/freshclam.conf %s" % config.get("CLIOPTS"),
|
||||
pidfile=PIDFILE,
|
||||
detach=True,
|
||||
donotify=True)
|
||||
|
||||
@synchronized
|
||||
def stop():
|
||||
stopService(command="/usr/bin/freshclam",
|
||||
pidfile=PIDFILE,
|
||||
donotify=True)
|
||||
if os.path.isfile(PIDFILE): os.unlink(PIDFILE)
|
||||
|
||||
def status():
|
||||
return isServiceRunning("/run/freshclam.pid")
|
||||
return isServiceRunning(PIDFILE)
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
|
||||
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
|
||||
os.system("/bin/chown clamav:clamav /var/lib/clamav -R")
|
||||
#os.system("/bin/chown clamav:clamav /run/clamav -R")
|
||||
#os.system("/bin/chown clamav:clamav /var/log/clamav -R")
|
||||
try:
|
||||
os.system("/usr/sbin/useradd -r -k /dev/null -m -b /var/lib -U clamav")
|
||||
except:
|
||||
pass
|
||||
|
||||
def postRemove():
|
||||
try:
|
||||
os.system("/usr/sbin/userdel -r clamav")
|
||||
os.system("/usr/sbin/groupdel clamav")
|
||||
except:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user