moved into main repo for pisi 2.0
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os, pwd, socket
|
||||
|
||||
pid_dir = "/run/firebird"
|
||||
log_file = "/var/log/firebird.log"
|
||||
|
||||
uid = pwd.getpwnam("firebird")[2]
|
||||
hostname = socket.gethostname()
|
||||
|
||||
def touch(filename):
|
||||
try:
|
||||
f = open(filename, "w")
|
||||
f.close()
|
||||
except IOError:
|
||||
fail("Failed to create %s file" % filename)
|
||||
|
||||
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
|
||||
# # Configure PID directory
|
||||
os.chown(pid_dir, uid, -1)
|
||||
|
||||
# Create log file
|
||||
touch(log_file)
|
||||
os.chown(log_file, uid, -1)
|
||||
os.chmod(log_file, 0644)
|
||||
|
||||
# Configure security2.fdb file
|
||||
os.chown("/opt/firebird/security2.fdb", uid, -1)
|
||||
|
||||
# Create lock files
|
||||
for lock_filename in ("isc_guard1", "isc_init1", "isc_lock1"):
|
||||
lock_filename = "/opt/firebird/%s.%s" % (lock_filename, hostname)
|
||||
touch(lock_filename)
|
||||
os.chown(lock_filename, uid, -1)
|
||||
os.chmod(lock_filename, 0644)
|
||||
|
||||
def preRemove():
|
||||
# Remove lock files
|
||||
for lock_filename in ("isc_guard1", "isc_init1", "isc_lock1"):
|
||||
lock_filename = "/opt/firebird/%s.%s" % (lock_filename, hostname)
|
||||
if os.path.exists(lock_filename):
|
||||
os.remove(lock_filename)
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
serviceType="server"
|
||||
serviceDesc = _({"en": "Firebird Database Server",
|
||||
"tr": "Firebird Veritabanı Sunucusu"})
|
||||
|
||||
from comar.service import *
|
||||
|
||||
pid_file = "/run/firebird/firebird.pid"
|
||||
|
||||
@synchronized
|
||||
def start():
|
||||
startService(command="/opt/firebird/bin/fbguard",
|
||||
args="-pidfile %s -start -forever -daemon" % pid_file,
|
||||
pidfile="/run/firebird/firebird.pid",
|
||||
donotify=True)
|
||||
# chuid="firebird",
|
||||
|
||||
@synchronized
|
||||
def stop():
|
||||
stopService(pidfile=pid_file,
|
||||
donotify=True)
|
||||
|
||||
def status():
|
||||
return isServiceRunning(pid_file)
|
||||
Reference in New Issue
Block a user