PREIN
<lua>
-- save ownership/permissions on the dirs/files that rpm changes
-- if these don't exist, the vars will be nil
dirsrvadmin_adminserv = posix.stat('/etc/dirsrv/admin-serv')
dirsrvadmin_consoleconf = posix.stat('/etc/dirsrv/admin-serv/console.conf')
PREUN
/bin/sh
if [ $1 = 0 ]; then
/sbin/service dirsrv-admin stop >/dev/null 2>&1 || :
/sbin/chkconfig --del dirsrv-admin
fi
POSTIN
<lua>
-- do the usual daemon post setup stuff
os.execute('/sbin/chkconfig --add dirsrv-admin')
os.execute('/sbin/ldconfig')
-- restore permissions if upgrading
if dirsrvadmin_adminserv then
posix.chmod('/etc/dirsrv/admin-serv', dirsrvadmin_adminserv.mode)
posix.chown('/etc/dirsrv/admin-serv', dirsrvadmin_adminserv.uid, dirsrvadmin_adminserv.gid)
end
if dirsrvadmin_consoleconf then
posix.chmod('/etc/dirsrv/admin-serv/console.conf', dirsrvadmin_consoleconf.mode)
posix.chown('/etc/dirsrv/admin-serv/console.conf', dirsrvadmin_consoleconf.uid, dirsrvadmin_consoleconf.gid)
end
POSTUN
/bin/sh
/sbin/ldconfig