Files
main/server/ntp/comar/ntpd-service.py
T
2016-01-01 17:28:30 +01:00

29 lines
603 B
Python

# -*- coding: utf-8 -*-
from comar.service import *
import os
serviceType = "server"
serviceDesc = _({"en": "NTP Daemon",
"tr": "NTP Hizmeti"})
serviceConf = "ntpd"
PIDFILE = "/run/ntpd.pid"
@synchronized
def start():
startService(command="/usr/sbin/ntpd",
args=config.get("OPTIONS", "-u ntp:ntp -p %s -g" % PIDFILE),
donotify=True)
@synchronized
def stop():
stopService(pidfile=PIDFILE,
donotify=True)
if os.path.exists(PIDFILE):
os.unlink(PIDFILE)
def status():
return isServiceRunning(pidfile=PIDFILE)