Updated Port: security/fakeident - rc.d script and localbase fix
Lately Dean Hollister told: > diff -ruN fakeident.old/Makefile fakeident/Makefile [...] > do-install: > - $(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(PREFIX)/sbin > - $(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/fakeident.sh $(PREFIX)/etc/rc.d > + $(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(LOCALBASE)/sbin > + $(INSTALL) -m 755 -o root -g wheel $(FILESDIR)/fakeident.sh $(LOCALBASE)/etc/rc.d are you sure about this? seems like making this not PREFIX clean. better use: ${INSTALL_PROGRAM} ${WRKSRC}/identd ${PREFIX}/sbin ${INSTALL_SCRIPT} ${FILESDIR}/fakeident.sh ${PREFIX}/etc/rc.d > diff -ruN fakeident.old/files/fakeident.sh fakeident/files/fakeident.sh [...] > +stop) > + kill -9 `cat /var/run/identd.pid` && echo -n ' fakeidentd' > + ;; how about checking for /var/run/identd.pid existance? otherwise stopping a not running fakeidentd will produce an ugly error message: cat: /var/run/identd.pid: No such file or directory cheers simon -- /"\ http://corecode.ath.cx/#donate \ / \ ASCII Ribbon Campaign / \ Against HTML Mail and News
At 10:56 23/01/2003 +0100, Simon 'corecode' Schubert wrote: >how about checking for /var/run/identd.pid existance? >otherwise stopping a not running fakeidentd will produce an ugly error >message: >cat: /var/run/identd.pid: No such file or directory simon-- The problem is that the identd daemon doesn't remove this file upon exiting, as a result, a stop will return a no such process error anyway. Kind of a case of 6 of one, half a dozen of the other... That said, it's certainly feasible to check for the existence of the pid file, and if it exists, send a kill to the pid in it and then rm the file, all within the rc.d script. Regards, d.
Following diff I believe addresses all issues satisfactorily now. :-) diff -ruN fakeident.old/Makefile fakeident/Makefile --- fakeident.old/Makefile Thu Jan 23 17:24:23 2003 +++ fakeident/Makefile Thu Jan 23 17:22:05 2003 @@ -7,6 +7,7 @@ PORTNAME= fakeident PORTVERSION= 1.7 +PORTREVISION= 1 CATEGORIES= security MASTER_SITES= http://www.wa.apana.org.au/~dean/sources/ \ ftp://ftp.wa.apana.org.au/pub/pc/unix/packages/ @@ -26,7 +27,7 @@ @echo "" do-install: - $(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(PREFIX)/sbin - $(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/fakeident.sh $(PREFIX)/etc/rc.d + $(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(LOCALBASE)/sbin + $(INSTALL) -m 755 -o root -g wheel $(FILESDIR)/fakeident.sh $(LOCALBASE)/etc/rc.d .include <bsd.port.mk> diff -ruN fakeident.old/files/fakeident.sh fakeident/files/fakeident.sh --- fakeident.old/files/fakeident.sh Thu Jan 1 08:00:00 1970 +++ fakeident/files/fakeident.sh Thu Jan 23 18:04:15 2003 @@ -0,0 +1,32 @@ +#! /bin/sh +# + +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin + +# This can be changed as desired. +# The username does not need to exist anywhere in your system. + +USERNAME=nobody + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +case "$1" in +start) + $PREFIX/sbin/identd $USERNAME && echo -n ' fakeidentd' + ;; + +stop) + if [ -r /var/run/identd.pid ] ; then + kill -9 `cat /var/run/identd.pid` >>/dev/null 2>&1 + rm -f /var/run/identd.pid + fi + ;; + +*) + echo "Usage: `basename $0` {start|stop}" >&2 + exit 64 + ;; +esac
Lately Dean Hollister told: > Following diff I believe addresses all issues satisfactorily now. :-) > > diff -ruN fakeident.old/Makefile fakeident/Makefile [...] > do-install: > - $(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(PREFIX)/sbin > - $(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/fakeident.sh $(PREFIX)/etc/rc.d > + $(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(LOCALBASE)/sbin > + $(INSTALL) -m 755 -o root -g wheel $(FILESDIR)/fakeident.sh $(LOCALBASE)/etc/rc.d uhm, i don't want to appear as being a nitpicky bitchy person, but please install into ${PREFIX} and while you're at it you may use ${INSTALL_PROGRAM} and ${INSTALL_SCRIPT} to get the owners and modes set as desired > diff -ruN fakeident.old/files/fakeident.sh fakeident/files/fakeident.sh [...] > +stop) > + if [ -r /var/run/identd.pid ] ; then > + kill -9 `cat /var/run/identd.pid` >>/dev/null 2>&1 > + rm -f /var/run/identd.pid > + fi > + ;; very nice cheers simon -- /"\ http://corecode.ath.cx/#donate \ / \ ASCII Ribbon Campaign / \ Against HTML Mail and News
Ok... How about.... diff -ruN fakeident.old/Makefile fakeident/Makefile --- fakeident.old/Makefile Thu Jan 23 17:24:23 2003 +++ fakeident/Makefile Thu Jan 23 18:24:24 2003 @@ -7,6 +7,7 @@ PORTNAME= fakeident PORTVERSION= 1.7 +PORTREVISION= 1 CATEGORIES= security MASTER_SITES= http://www.wa.apana.org.au/~dean/sources/ \ ftp://ftp.wa.apana.org.au/pub/pc/unix/packages/ @@ -26,7 +27,7 @@ @echo "" do-install: - $(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(PREFIX)/sbin - $(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/fakeident.sh $(PREFIX)/etc/rc.d + $(INSTALL_SCRIPT) $(WRKSRC)/identd $(PREFIX)/sbin + $(INSTALL_SCRIPT) $(FILESDIR)/fakeident.sh $(PREFIX)/etc/rc.d .include <bsd.port.mk> diff -ruN fakeident.old/files/fakeident.sh fakeident/files/fakeident.sh --- fakeident.old/files/fakeident.sh Thu Jan 1 08:00:00 1970 +++ fakeident/files/fakeident.sh Thu Jan 23 18:04:15 2003 @@ -0,0 +1,32 @@ +#! /bin/sh +# + +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin + +# This can be changed as desired. +# The username does not need to exist anywhere in your system. + +USERNAME=nobody + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +case "$1" in +start) + $PREFIX/sbin/identd $USERNAME && echo -n ' fakeidentd' + ;; + +stop) + if [ -r /var/run/identd.pid ] ; then + kill -9 `cat /var/run/identd.pid` >>/dev/null 2>&1 + rm -f /var/run/identd.pid + fi + ;; + +*) + echo "Usage: `basename $0` {start|stop}" >&2 + exit 64 + ;; +esac
State Changed From-To: open->closed Commited, thanks!