[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: corel




Jeff Licquia said:
> On Mon, Dec 13, 1999 at 09:54:14AM -0600, Burke, Jason wrote:
> > Although, it was my understanding that rpm couldn't run scripts on post
> > or pre-installation. 
> 
> RPM can (for an example, look at the sshd packages), but it's
> discouraged.

By who?  It's always seemed to me that people don't include these
scripts due to a simple lack of attention to detail.

In my ftpd.spec, I have the following:

%preun
if [ $1 = 0 -a -f /var/lock/subsys/ftpd -a -x /etc/rc.d/init.d/ftpd ] ; then
    /etc/rc.d/init.d/ftpd stop
fi

%post
/usr/sbin/mkusers
/sbin/chkconfig --add ftpd
if [ -f /var/lock/subsys/ftpd ] ; then
    /etc/rc.d/init.d/ftpd restart
fi

%postun
if [ $1 = 0 ]; then
    /sbin/chkconfig --del ftpd
fi

All that makes upgrading a running ftpd pretty painless.  (And yes,
the idea and probably some of the code was borrowed from the replay
ssh rpm.  :)

Steve
-- 
steve@silug.org           | Linux Users of Central Illinois
(217)698-1694             | Meetings the 4th Tuesday of every month
Steven Pritchard          | http://www.luci.org/ for more info

--
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.