Use rc.subr.

This commit is contained in:
Jimmy Olgeni 2004-06-19 20:58:44 +00:00
parent 2998f14b5b
commit 16ebae5b9a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=111831
15 changed files with 196 additions and 196 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= usermin PORTNAME= usermin
PORTVERSION= 1.080 PORTVERSION= 1.080
PORTREVISION= 1 PORTREVISION= 2
CATEGORIES= sysutils CATEGORIES= sysutils
MASTER_SITES= http://www.webmin.com/uupdates/ \ MASTER_SITES= http://www.webmin.com/uupdates/ \
${MASTER_SITE_SOURCEFORGE} ${MASTER_SITE_SOURCEFORGE}
@ -23,7 +23,8 @@ RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Net/SSLeay.pm:${PORTSDIR}/security/p5-Net
NO_BUILD= yes NO_BUILD= yes
USE_PERL5= yes USE_PERL5= yes
SCRIPTS_ENV+= WRKDIR="${WRKDIR}" USE_RC_SUBR= yes
USE_REINPLACE= yes
USERMIN_MODULES=quota-1.080-1.wbm.gz USERMIN_MODULES=quota-1.080-1.wbm.gz
@ -36,27 +37,33 @@ post-extract:
${TAR} --unlink -xzf ${DISTDIR}/$${usermin_module} -C ${WRKSRC}; \ ${TAR} --unlink -xzf ${DISTDIR}/$${usermin_module} -C ${WRKSRC}; \
done; \ done; \
fi fi
@${FIND} ${WRKSRC} -name "*.orig" -or -name "*.bak" | ${XARGS} ${RM}
post-patch:
@${REINPLACE_CMD} -e "s=%%PREFIX%%=${PREFIX}=" ${WRKSRC}/setup.sh
@${FIND} ${WRKSRC} -name "*.cgi" -print \
| ${XARGS} ${REINPLACE_CMD} -e "s@/usr/local/bin/perl@${PERL}@"
@${FIND} ${WRKSRC} -name "*.orig" -print | ${XARGS} ${RM}
@${FIND} ${WRKSRC} -name "*.bak" -print | ${XARGS} ${RM}
# we may have 2 levels of empty directories which cause the plist generation
# system to fail
@${FIND} ${WRKSRC} -type d -empty -print | ${XARGS} ${RMDIR}
@${FIND} ${WRKSRC} -type d -empty -print | ${XARGS} ${RMDIR}
do-install: do-install:
@${MKDIR} ${PREFIX}/lib/usermin @${MKDIR} ${PREFIX}/lib/usermin
@${CP} -r ${WRKSRC}/* ${PREFIX}/lib/usermin @${CP} -r ${WRKSRC}/* ${PREFIX}/lib/usermin
# we may have 2 levels of empty directories which cause the plist generation @${SED} -e "s=%%RC_SUBR%%=${RC_SUBR}=" \
# system to fail -e "s=%%PREFIX%%=${PREFIX}=" \
@cd ${PREFIX}/lib/usermin && ${FIND} . -type d -empty -print \ -e "s=%%PERL5%%=${PERL}=" \
| ${XARGS} ${RMDIR} < ${FILESDIR}/usermin.sh.sample > ${PREFIX}/etc/rc.d/usermin.sh
@cd ${PREFIX}/lib/usermin && ${FIND} . -type d -empty -print \ @${CHMOD} 555 ${PREFIX}/etc/rc.d/usermin.sh
| ${XARGS} ${RMDIR}
@${CP} ${WRKDIR}/usermin.sh ${PREFIX}/etc/rc.d/usermin.sh-dist
@${CHMOD} 554 ${PREFIX}/etc/rc.d/usermin.sh-dist
post-install: post-install:
@cd ${PREFIX} ; ${FIND} lib/usermin -type f -o -type l | ${SORT} \ @cd ${WRKSRC} ; ${FIND} * -type f -o -type l | ${SORT} | ${AWK} \
> ${WRKDIR}/PLIST.lib-usermin '{ print "lib/usermin/" $$1 }' > ${WRKDIR}/PLIST.lib-usermin
@cd ${PREFIX} ; ${FIND} lib/usermin -type d | ${SORT} -r \ @cd ${WRKSRC} ; ${FIND} * -type d | ${SORT} -r | ${AWK} \
| ${SED} -e 's/^/@dirrm /g' \ '{ print "lib/usermin/" $$1 }' | ${SED} -e 's/^/@dirrm /g' \
>> ${WRKDIR}/PLIST.lib-usermin >> ${WRKDIR}/PLIST.lib-webmin
@${ECHO_CMD} "r ${TMPPLIST}" > ${WRKDIR}/ex.script @${ECHO_CMD} "r ${TMPPLIST}" > ${WRKDIR}/ex.script
@${ECHO_CMD} "/Insert PLIST.lib-usermin" >> ${WRKDIR}/ex.script @${ECHO_CMD} "/Insert PLIST.lib-usermin" >> ${WRKDIR}/ex.script
@${ECHO_CMD} "d" >> ${WRKDIR}/ex.script @${ECHO_CMD} "d" >> ${WRKDIR}/ex.script
@ -64,12 +71,6 @@ post-install:
@${ECHO_CMD} "x!" >> ${WRKDIR}/ex.script @${ECHO_CMD} "x!" >> ${WRKDIR}/ex.script
@${CP} -p ${TMPPLIST} ${TMPPLIST}.pre-lib-usermin @${CP} -p ${TMPPLIST} ${TMPPLIST}.pre-lib-usermin
@cd ${WRKDIR} ; ex < ex.script @cd ${WRKDIR} ; ex < ex.script
# stop usermin if configured and enabled at startup
@[ -n "${BATCH}" ] || ([ ! -d ${PREFIX}/etc/usermin ] || [ ! -x ${PREFIX}/etc/rc.d/usermin.sh ] || ${PREFIX}/etc/rc.d/usermin.sh stop > /dev/null)
# upgrade configuration if etc/usermin exists
@[ ! -d ${PREFIX}/etc/usermin ] || ${ECHO_CMD} | nostart=Y ${PREFIX}/lib/usermin/setup.sh
# run interactive setup if not in BATCH mode and no configuration exists
@[ -n "${BATCH}" ] || ([ -d ${PREFIX}/etc/usermin ] || nostart=Y ${PREFIX}/lib/usermin/setup.sh)
@${CAT} ${PKGMESSAGE} @${CAT} ${PKGMESSAGE}
.include <bsd.port.mk> .include <bsd.port.mk>

View file

@ -1,20 +1,20 @@
$FreeBSD$ $FreeBSD$
--- setup.sh.orig Sat Jan 31 10:52:05 2004 --- setup.sh.orig Fri Jun 4 01:18:07 2004
+++ setup.sh Sat Jan 31 10:55:35 2004 +++ setup.sh Sat Jun 19 21:59:35 2004
@@ -84,12 +84,12 @@ @@ -84,12 +84,12 @@
echo "Unless you want to run multiple versions of Usermin at the same time" echo "Unless you want to run multiple versions of Usermin at the same time"
echo "you can just accept the defaults." echo "you can just accept the defaults."
echo "" echo ""
-printf "Config file directory [/etc/usermin]: " -printf "Config file directory [/etc/usermin]: "
+printf "Config file directory [!!PREFIX!!/etc/usermin]: " +printf "Config file directory [%%PREFIX%%/etc/usermin]: "
if [ "$config_dir" = "" ]; then if [ "$config_dir" = "" ]; then
read config_dir read config_dir
fi fi
if [ "$config_dir" = "" ]; then if [ "$config_dir" = "" ]; then
- config_dir=/etc/usermin - config_dir=/etc/usermin
+ config_dir=!!PREFIX!!/etc/usermin + config_dir=%%PREFIX%%/etc/usermin
fi fi
abspath=`echo $config_dir | grep "^/"` abspath=`echo $config_dir | grep "^/"`
if [ "$abspath" = "" ]; then if [ "$abspath" = "" ]; then
@ -38,9 +38,17 @@ $FreeBSD$
echo "Perl 5 interpreter on your system." echo "Perl 5 interpreter on your system."
echo "" echo ""
- if [ -x /usr/bin/perl ]; then - if [ -x /usr/bin/perl ]; then
+ if [ -x !!PERL!! ]; then + if [ -x %%PERL%% ]; then
+ perldef=!!PERL!! + perldef=%%PERL%%
+ elif [ -x /usr/bin/perl ]; then + elif [ -x /usr/bin/perl ]; then
perldef=/usr/bin/perl perldef=/usr/bin/perl
elif [ -x /usr/local/bin/perl ]; then elif [ -x /usr/local/bin/perl ]; then
perldef=/usr/local/bin/perl perldef=/usr/local/bin/perl
@@ -465,7 +467,6 @@
echo "Creating start and stop scripts.."
rm -f $config_dir/stop $config_dir/start
echo "#!/bin/sh" >>$config_dir/start
-echo "echo Starting Usermin server in $wadir" >>$config_dir/start
echo "trap '' 1" >>$config_dir/start
echo "LANG=" >>$config_dir/start
echo "export LANG" >>$config_dir/start

View file

@ -1,27 +1,28 @@
#!/bin/sh #!/bin/sh
#
# $FreeBSD$ # $FreeBSD$
#
# PROVIDE: usermin
# REQUIRE: LOGIN
# KEYWORD: FreeBSD
#
# Add the following line to /etc/rc.conf to enable usermin:
#
# usermin_enable="YES"
#
case $1 in usermin_enable="NO"
start) . %%RC_SUBR%%
if [ -x !!PREFIX!!/etc/usermin/start ]; then
!!PREFIX!!/etc/usermin/start >/dev/null
echo -n ' usermin'
fi
exit 0
;;
stop) name=usermin
if [ -x !!PREFIX!!/etc/usermin/stop ]; then rcvar=`set_rcvar`
!!PREFIX!!/etc/usermin/stop >/dev/null
echo -n ' usermin'
fi
exit 0
;;
*) prefix=%%PREFIX%%
echo "usage: `basename $0` {start|stop}" >&2 procname=%%PERL5%%
exit 64 pidfile=/var/log/usermin/miniserv.pid
;; required_dirs=${prefix}/etc/usermin
esac command=${prefix}/etc/usermin/start
load_rc_config ${name}
run_rc_command "$1"

View file

@ -1,27 +1,28 @@
#!/bin/sh #!/bin/sh
#
# $FreeBSD$ # $FreeBSD$
#
# PROVIDE: usermin
# REQUIRE: LOGIN
# KEYWORD: FreeBSD
#
# Add the following line to /etc/rc.conf to enable usermin:
#
# usermin_enable="YES"
#
case $1 in usermin_enable="NO"
start) . %%RC_SUBR%%
if [ -x !!PREFIX!!/etc/usermin/start ]; then
!!PREFIX!!/etc/usermin/start >/dev/null
echo -n ' usermin'
fi
exit 0
;;
stop) name=usermin
if [ -x !!PREFIX!!/etc/usermin/stop ]; then rcvar=`set_rcvar`
!!PREFIX!!/etc/usermin/stop >/dev/null
echo -n ' usermin'
fi
exit 0
;;
*) prefix=%%PREFIX%%
echo "usage: `basename $0` {start|stop}" >&2 procname=%%PERL5%%
exit 64 pidfile=/var/log/usermin/miniserv.pid
;; required_dirs=${prefix}/etc/usermin
esac command=${prefix}/etc/usermin/start
load_rc_config ${name}
run_rc_command "$1"

View file

@ -8,4 +8,8 @@ run the following command as root:
You won't have to perform this step You won't have to perform this step
after every usermin upgrade. after every usermin upgrade.
Since 1.080_2, to run usermin from
startup, add usermin_enable="YES"
in your /etc/rc.conf.
=================================== ===================================

View file

@ -1,10 +1,5 @@
@comment stop service at deinstall time etc/rc.d/usermin.sh
@unexec [ -n "$BATCH" ] || ([ ! -d %D/etc/usermin ] || [ ! -x %D/etc/rc.d/usermin.sh ] || %D/etc/rc.d/usermin.sh stop >/dev/null )
etc/rc.d/usermin.sh-dist
@comment Insert PLIST.lib-usermin here @comment Insert PLIST.lib-usermin here
@comment -=[ begin PLIST.lib-usermin ]=- @comment -=[ begin PLIST.lib-usermin ]=-
@comment -=[ end PLIST.lib-usermin ]=- @comment -=[ end PLIST.lib-usermin ]=-
@comment upgrade configuration if etc/usermin exists @dirrm lib/usermin
@exec [ ! -d %D/etc/usermin ] || echo | nostart=Y %D/lib/usermin/setup.sh
@comment run interactive setup if not in BATCH mode and no configuration exists
@exec [ -n "$BATCH" ] || ([ -d %D/etc/usermin ] || nostart=Y %D/lib/usermin/setup.sh)

View file

@ -1,15 +0,0 @@
#! /bin/sh
perl -pi -e "s=!!PREFIX!!=$PREFIX=" ${WRKSRC}/setup.sh
if [ -x /usr/bin/perl5 ]; then
PERL5=/usr/bin/perl
elif [ -x $PREFIX/bin/perl ]; then
PERL5=$PREFIX/bin/perl
fi
perl -pi -e "s=!!PERL5!!=$PERL5=" ${WRKSRC}/setup.sh
sed -e "s=!!PREFIX!!=$PREFIX=" < ${FILESDIR}/usermin.sh.sample > ${WRKDIR}/usermin.sh
exit 0

View file

@ -7,7 +7,7 @@
PORTNAME= webmin PORTNAME= webmin
PORTVERSION= 1.150 PORTVERSION= 1.150
PORTREVISION= 1 PORTREVISION= 2
CATEGORIES= sysutils CATEGORIES= sysutils
MASTER_SITES= http://www.webmin.com/updates/ \ MASTER_SITES= http://www.webmin.com/updates/ \
${MASTER_SITE_SOURCEFORGE} ${MASTER_SITE_SOURCEFORGE}
@ -23,7 +23,8 @@ RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Net/SSLeay.pm:${PORTSDIR}/security/p5-Net
NO_BUILD= yes NO_BUILD= yes
USE_PERL5= yes USE_PERL5= yes
SCRIPTS_ENV+= WRKDIR="${WRKDIR}" USE_RC_SUBR= yes
USE_REINPLACE= yes
WEBMIN_MODULES= fsdump-1.150-1.wbm.gz WEBMIN_MODULES= fsdump-1.150-1.wbm.gz
@ -36,7 +37,6 @@ post-extract:
${TAR} --unlink -xzf ${DISTDIR}/$${webmin_module} -C ${WRKSRC}; \ ${TAR} --unlink -xzf ${DISTDIR}/$${webmin_module} -C ${WRKSRC}; \
done; \ done; \
fi fi
@${FIND} ${WRKSRC} -name "*.bak" | ${XARGS} ${RM}
post-patch: post-patch:
@${CP} ${WRKDIR}/webmin-${PORTVERSION}/bind8/config-freebsd-3.0 \ @${CP} ${WRKDIR}/webmin-${PORTVERSION}/bind8/config-freebsd-3.0 \
@ -56,6 +56,9 @@ post-patch:
usermin/config usermin/config
@${PERL} -pi -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/${file} @${PERL} -pi -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/${file}
.endfor .endfor
@${REINPLACE_CMD} -e "s=%%PREFIX%%=${PREFIX}=" ${WRKSRC}/setup.sh
@${FIND} ${WRKSRC} -name "*.cgi" -print \
| ${XARGS} ${REINPLACE_CMD} -e "s@/usr/local/bin/perl@${PERL}@"
@${FIND} ${WRKSRC} -name "*.orig" -print | ${XARGS} ${RM} @${FIND} ${WRKSRC} -name "*.orig" -print | ${XARGS} ${RM}
@${FIND} ${WRKSRC} -name "*.bak" -print | ${XARGS} ${RM} @${FIND} ${WRKSRC} -name "*.bak" -print | ${XARGS} ${RM}
# we may have 2 levels of empty directories which cause the plist generation # we may have 2 levels of empty directories which cause the plist generation
@ -66,8 +69,11 @@ post-patch:
do-install: do-install:
@${MKDIR} ${PREFIX}/lib/webmin @${MKDIR} ${PREFIX}/lib/webmin
@${CP} -r ${WRKSRC}/* ${PREFIX}/lib/webmin @${CP} -r ${WRKSRC}/* ${PREFIX}/lib/webmin
@${CP} ${WRKDIR}/webmin.sh ${PREFIX}/etc/rc.d/webmin.sh-dist @${SED} -e "s=%%RC_SUBR%%=${RC_SUBR}=" \
@${CHMOD} 554 ${PREFIX}/etc/rc.d/webmin.sh-dist -e "s=%%PREFIX%%=${PREFIX}=" \
-e "s=%%PERL5%%=${PERL}=" \
< ${FILESDIR}/webmin.sh.sample > ${PREFIX}/etc/rc.d/webmin.sh
@${CHMOD} 555 ${PREFIX}/etc/rc.d/webmin.sh
post-install: post-install:
@cd ${WRKSRC} ; ${FIND} * -type f -o -type l | ${SORT} | ${AWK} \ @cd ${WRKSRC} ; ${FIND} * -type f -o -type l | ${SORT} | ${AWK} \
@ -75,7 +81,6 @@ post-install:
@cd ${WRKSRC} ; ${FIND} * -type d | ${SORT} -r | ${AWK} \ @cd ${WRKSRC} ; ${FIND} * -type d | ${SORT} -r | ${AWK} \
'{ print "lib/webmin/" $$1 }' | ${SED} -e 's/^/@dirrm /g' \ '{ print "lib/webmin/" $$1 }' | ${SED} -e 's/^/@dirrm /g' \
>> ${WRKDIR}/PLIST.lib-webmin >> ${WRKDIR}/PLIST.lib-webmin
@${ECHO_CMD} "r ${TMPPLIST}" > ${WRKDIR}/ex.script @${ECHO_CMD} "r ${TMPPLIST}" > ${WRKDIR}/ex.script
@${ECHO_CMD} "/Insert PLIST.lib-webmin" >> ${WRKDIR}/ex.script @${ECHO_CMD} "/Insert PLIST.lib-webmin" >> ${WRKDIR}/ex.script
@${ECHO_CMD} "d" >> ${WRKDIR}/ex.script @${ECHO_CMD} "d" >> ${WRKDIR}/ex.script
@ -83,12 +88,6 @@ post-install:
@${ECHO_CMD} "x!" >> ${WRKDIR}/ex.script @${ECHO_CMD} "x!" >> ${WRKDIR}/ex.script
@${CP} -p ${TMPPLIST} ${TMPPLIST}.pre-lib-webmin @${CP} -p ${TMPPLIST} ${TMPPLIST}.pre-lib-webmin
@cd ${WRKDIR} ; ex < ex.script @cd ${WRKDIR} ; ex < ex.script
# stop webmin if configured and enabled at startup
@[ -n "${BATCH}" ] || ([ ! -d ${PREFIX}/etc/webmin ] || [ ! -x ${PREFIX}/etc/rc.d/webmin.sh ] || ${PREFIX}/etc/rc.d/webmin.sh stop > /dev/null)
# upgrade configuration if etc/webmin exists
@[ ! -d ${PREFIX}/etc/webmin ] || ${ECHO_CMD} | nostart=Y ${PREFIX}/lib/webmin/setup.sh
# run interactive setup if not in BATCH mode and no configuration exists
@[ -n "${BATCH}" ] || ([ -d ${PREFIX}/etc/webmin ] || nostart=Y ${PREFIX}/lib/webmin/setup.sh)
@${CAT} ${PKGMESSAGE} @${CAT} ${PKGMESSAGE}
.include <bsd.port.mk> .include <bsd.port.mk>

View file

@ -1,23 +1,26 @@
--- setup.sh.orig Mon Dec 13 12:57:41 1999
+++ setup.sh Tue Dec 14 10:20:32 1999 $FreeBSD$
@@ -33,12 +33,12 @@
--- setup.sh.orig Fri Jun 4 01:15:55 2004
+++ setup.sh Sat Jun 19 19:24:25 2004
@@ -89,12 +89,12 @@
echo "Unless you want to run multiple versions of Webmin at the same time" echo "Unless you want to run multiple versions of Webmin at the same time"
echo "you can just accept the defaults." echo "you can just accept the defaults."
echo "" echo ""
-printf "Config file directory [/etc/webmin]: " -printf "Config file directory [/etc/webmin]: "
+printf "Config file directory [!!PREFIX!!/etc/webmin]: " +printf "Config file directory [%%PREFIX%%/etc/webmin]: "
if [ "$config_dir" = "" ]; then if [ "$config_dir" = "" ]; then
read config_dir read config_dir
fi fi
if [ "$config_dir" = "" ]; then if [ "$config_dir" = "" ]; then
- config_dir=/etc/webmin - config_dir=/etc/webmin
+ config_dir=!!PREFIX!!/etc/webmin + config_dir=%%PREFIX%%/etc/webmin
fi fi
abspath=`echo $config_dir | grep "^/"` abspath=`echo $config_dir | grep "^/"`
if [ "$abspath" = "" ]; then if [ "$abspath" = "" ]; then
@@ -106,12 +106,12 @@ @@ -199,12 +199,12 @@
fi fi
else
# Ask for log directory # Ask for log directory
- printf "Log file directory [/var/webmin]: " - printf "Log file directory [/var/webmin]: "
+ printf "Log file directory [/var/log/webmin]: " + printf "Log file directory [/var/log/webmin]: "
@ -30,31 +33,53 @@
fi fi
abspath=`echo $var_dir | grep "^/"` abspath=`echo $var_dir | grep "^/"`
if [ "$abspath" = "" ]; then if [ "$abspath" = "" ]; then
@@ -135,7 +135,9 @@ @@ -232,7 +232,9 @@
echo "Webmin is written entirely in Perl. Please enter the full path to the" echo "Webmin is written entirely in Perl. Please enter the full path to the"
echo "Perl 5 interpreter on your system." echo "Perl 5 interpreter on your system."
echo "" echo ""
- if [ -x /usr/bin/perl ]; then - if [ -x /usr/bin/perl ]; then
+ if [ -x !!PERL5!! ]; then + if [ -x %%PERL5%% ]; then
+ perldef=!!PERL5!! + perldef=%%PERL5%%
+ elif [ -x /usr/bin/perl ]; then + elif [ -x /usr/bin/perl ]; then
perldef=/usr/bin/perl perldef=/usr/bin/perl
elif [ -x /usr/local/bin/perl ]; then elif [ -x /usr/local/bin/perl ]; then
perldef=/usr/local/bin/perl perldef=/usr/local/bin/perl
@@ -313,11 +315,11 @@ @@ -418,22 +420,6 @@
initsupp=`grep "^os_support=" $wadir/init/module.info | sed -e 's/os_support=//g' | grep $os_type` fi
atboot=0 fi
if [ "$initsupp" != "" ]; then
- # Ask whether to run at boot time
- if [ "$atboot" = "" ]; then
- initsupp=`grep "^os_support=" "$srcdir/init/module.info" | sed -e 's/os_support=//g' | grep $os_type`
- atboot=0
- if [ "$initsupp" != "" ]; then
- printf "Start Webmin at boot time (y/n): " - printf "Start Webmin at boot time (y/n): "
- read atbootyn - read atbootyn
- if [ "$atbootyn" = "y" -o "$atbootyn" = "Y" ]; then - if [ "$atbootyn" = "y" -o "$atbootyn" = "Y" ]; then
- atboot=1 - atboot=1
- fi - fi
+ # printf "Start Webmin at boot time (y/n): " - else
+ # read atbootyn - echo "Webmin does not support being started at boot time on your system."
+ # if [ "$atbootyn" = "y" -o "$atbootyn" = "Y" ]; then - fi
+ # atboot=1 - fi
+ # fi - makeboot=$atboot
else -
echo "Webmin does not support being started at boot time on your system." # Copy files to target directory
fi echo "***********************************************************************"
if [ "$wadir" != "$srcdir" ]; then
@@ -535,6 +521,7 @@
fi
fi
+noperlpath="yes"
if [ "$noperlpath" = "" ]; then
echo "Inserting path to perl into scripts.."
(find "$wadir" -name '*.cgi' -print ; find "$wadir" -name '*.pl' -print) | $perl "$wadir/perlpath.pl" $perl -
@@ -545,7 +532,6 @@
echo "Creating start and stop scripts.."
rm -f $config_dir/stop $config_dir/start $config_dir/restart
echo "#!/bin/sh" >>$config_dir/start
-echo "echo Starting Webmin server in $wadir" >>$config_dir/start
echo "trap '' 1" >>$config_dir/start
echo "LANG=" >>$config_dir/start
echo "export LANG" >>$config_dir/start

View file

@ -1,29 +1,28 @@
#!/bin/sh #!/bin/sh
#
# $FreeBSD$ # $FreeBSD$
#
# PROVIDE: webmin
# REQUIRE: LOGIN
# KEYWORD: FreeBSD
#
# Add the following line to /etc/rc.conf to enable webmin:
#
# webmin_enable="YES"
#
case $1 in webmin_enable="NO"
start) . %%RC_SUBR%%
LD_PRELOAD=/usr/lib/libpam.so
export LD_PRELOAD
if [ -x !!PREFIX!!/etc/webmin/start ]; then
!!PREFIX!!/etc/webmin/start >/dev/null
echo -n ' webmin'
fi
exit 0
;;
stop) name=webmin
if [ -x !!PREFIX!!/etc/webmin/stop ]; then rcvar=`set_rcvar`
!!PREFIX!!/etc/webmin/stop >/dev/null
echo -n ' webmin'
fi
exit 0
;;
*) prefix=%%PREFIX%%
echo "usage: `basename $0` {start|stop}" >&2 procname=%%PERL5%%
exit 64 pidfile=/var/log/webmin/miniserv.pid
;; required_dirs=${prefix}/etc/webmin
esac command=${prefix}/etc/webmin/start
load_rc_config ${name}
run_rc_command "$1"

View file

@ -1,29 +1,28 @@
#!/bin/sh #!/bin/sh
#
# $FreeBSD$ # $FreeBSD$
#
# PROVIDE: webmin
# REQUIRE: LOGIN
# KEYWORD: FreeBSD
#
# Add the following line to /etc/rc.conf to enable webmin:
#
# webmin_enable="YES"
#
case $1 in webmin_enable="NO"
start) . %%RC_SUBR%%
LD_PRELOAD=/usr/lib/libpam.so
export LD_PRELOAD
if [ -x !!PREFIX!!/etc/webmin/start ]; then
!!PREFIX!!/etc/webmin/start >/dev/null
echo -n ' webmin'
fi
exit 0
;;
stop) name=webmin
if [ -x !!PREFIX!!/etc/webmin/stop ]; then rcvar=`set_rcvar`
!!PREFIX!!/etc/webmin/stop >/dev/null
echo -n ' webmin'
fi
exit 0
;;
*) prefix=%%PREFIX%%
echo "usage: `basename $0` {start|stop}" >&2 procname=%%PERL5%%
exit 64 pidfile=/var/log/webmin/miniserv.pid
;; required_dirs=${prefix}/etc/webmin
esac command=${prefix}/etc/webmin/start
load_rc_config ${name}
run_rc_command "$1"

View file

@ -4,6 +4,6 @@ user accounts, Apache, DNS, file sharing and so on.
Webmin consists of a simple web server, and a number of CGI programs Webmin consists of a simple web server, and a number of CGI programs
which directly update system files like /etc/inetd.conf and which directly update system files like /etc/inetd.conf and
/etc/passwd. /etc/master.passwd.
WWW: http://www.webmin.com/webmin/ WWW: http://www.webmin.com/webmin/

View file

@ -8,4 +8,8 @@ run the following command as root:
You won't have to perform this step You won't have to perform this step
after every webmin upgrade. after every webmin upgrade.
Since 1.150_2, to run webmin from
startup, add webmin_enable="YES"
in your /etc/rc.conf.
=================================== ===================================

View file

@ -1,11 +1,5 @@
@comment stop service at deinstall time etc/rc.d/webmin.sh
@unexec [ -n "$BATCH" ] || ([ ! -d %D/etc/webmin ] || [ ! -x %D/etc/rc.d/webmin.sh ] || %D/etc/rc.d/webmin.sh stop >/dev/null )
etc/rc.d/webmin.sh-dist
@comment Insert PLIST.lib-webmin here @comment Insert PLIST.lib-webmin here
@comment -=[ begin PLIST.lib-webmin ]=- @comment -=[ begin PLIST.lib-webmin ]=-
@comment -=[ end PLIST.lib-webmin ]=- @comment -=[ end PLIST.lib-webmin ]=-
@dirrm lib/webmin @dirrm lib/webmin
@comment upgrade configuration if etc/webmin exists
@exec [ ! -d %D/etc/webmin ] || echo | nostart=Y %D/lib/webmin/setup.sh
@comment run interactive setup if not in BATCH mode and no configuration exists
@exec [ -n "$BATCH" ] || ([ -d %D/etc/webmin ] || nostart=Y %D/lib/webmin/setup.sh)

View file

@ -1,15 +0,0 @@
#! /bin/sh
perl -pi -e "s=!!PREFIX!!=$PREFIX=" ${WRKSRC}/setup.sh
if [ -x /usr/bin/perl5 ]; then
PERL5=/usr/bin/perl
elif [ -x $PREFIX/bin/perl ]; then
PERL5=$PREFIX/bin/perl
fi
perl -pi -e "s=!!PERL5!!=$PERL5=" ${WRKSRC}/setup.sh
sed -e "s=!!PREFIX!!=$PREFIX=" < ${FILESDIR}/webmin.sh.sample > ${WRKDIR}/webmin.sh
exit 0