Import rc.d/httpd script for httpd(8) daemon control.

See rc.conf(5) for options explanation.
This commit is contained in:
mishka 2008-12-11 13:55:16 +00:00
parent 3ec1800aa0
commit 43e91ff9f2
8 changed files with 73 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.202 2008/12/05 18:56:47 cube Exp $
# $NetBSD: mi,v 1.203 2008/12/11 13:55:16 mishka Exp $
#
# Note: end-user configuration files that are moved to another location
# should not be marked "obsolete"; they should just be removed from
@ -191,6 +191,7 @@
./etc/rc.d/ftp_proxy etc-net-rc
./etc/rc.d/ftpd etc-net-rc
./etc/rc.d/hostapd etc-net-rc
./etc/rc.d/httpd etc-net-rc
./etc/rc.d/gated etc-obsolete obsolete
./etc/rc.d/identd etc-net-rc
./etc/rc.d/ifwatchd etc-net-rc

View File

@ -1,4 +1,4 @@
# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1150 $>
# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1151 $>
#
#
# [Note: This file does not mention every change made to the NetBSD source tree.
@ -74,3 +74,4 @@ Changes from NetBSD 5.0 to NetBSD 6.0:
[njoly 20081205]
ddb(4): Add 'show vmem' and 'show all vmems' commands.
[cegger 20081207]
httpd(8): Add rc.d script to control httpd daemon [mishka 20081211]

View File

@ -1,4 +1,4 @@
# $NetBSD: rc.conf,v 1.96 2008/11/12 12:35:52 ad Exp $
# $NetBSD: rc.conf,v 1.97 2008/12/11 13:55:16 mishka Exp $
#
# /etc/defaults/rc.conf --
# default configuration of /etc/rc.conf
@ -205,6 +205,9 @@ lpd=NO lpd_flags="-s" # -s "secure" unix domain only
sshd=NO sshd_flags=""
ssh_keygen_flags="-b 1024" # generate 1024 bit keys if host keys missing
ftpd=NO ftpd_flags="-ll"
httpd=NO httpd_flags=""
httpd_wwwdir="/var/www"
httpd_wwwuser="_httpd"
# To run the named(8) DNS server as an unprivileged user under a
# chroot(2) cage, uncomment the following after migrating the contents

View File

@ -1,4 +1,4 @@
# $NetBSD: special,v 1.122 2008/11/12 12:35:52 ad Exp $
# $NetBSD: special,v 1.123 2008/12/11 13:55:17 mishka Exp $
# @(#)special 8.2 (Berkeley) 1/23/94
#
# This file may be overwritten on upgrades.
@ -205,6 +205,7 @@
./etc/rc.d/ftp_proxy type=file mode=0555
./etc/rc.d/ftpd type=file mode=0555
./etc/rc.d/hostapd type=file mode=0555
./etc/rc.d/httpd type=file mode=0555
./etc/rc.d/identd type=file mode=0555
./etc/rc.d/ifwatchd type=file mode=0555
./etc/rc.d/inetd type=file mode=0555

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.70 2008/12/05 18:55:22 cube Exp $
# $NetBSD: Makefile,v 1.71 2008/12/11 13:55:17 mishka Exp $
.include <bsd.own.mk>
@ -14,7 +14,7 @@ CONFIGFILES=\
ccd cgd cleartmp cron \
dhclient dhcpd dhcrelay dmesg downinterfaces envsys \
fsck ftp_proxy ftpd \
hostapd \
hostapd httpd \
identd ifwatchd inetd ipfilter ipfs ipmon ipnat ipsec \
irdaattach iscsi_target isdnd \
kdc \

22
etc/rc.d/httpd Normal file
View File

@ -0,0 +1,22 @@
#!/bin/sh
#
# $NetBSD: httpd,v 1.1 2008/12/11 13:55:17 mishka Exp $
#
# PROVIDE: httpd
# REQUIRE: LOGIN
# KEYWORD: shutdown
$_rc_subr_loaded . /etc/rc.subr
name="httpd"
rcvar=$name
command="/usr/libexec/${name}"
load_rc_config $name
httpd_wwwuser_arg=${httpd_wwwuser:+-U \'$httpd_wwwuser\'}
command_args="$httpd_wwwuser_arg -b '$httpd_wwwdir'"
required_dirs="$httpd_wwwdir"
run_rc_command "$1"

View File

@ -1,4 +1,4 @@
.\" $NetBSD: rc.conf.5,v 1.122 2008/11/12 12:35:53 ad Exp $
.\" $NetBSD: rc.conf.5,v 1.123 2008/12/11 13:55:17 mishka Exp $
.\"
.\" Copyright (c) 1996 Matthew R. Green
.\" All rights reserved.
@ -837,6 +837,42 @@ or
.Sq NO .
Run
.Xr cron 8 .
.It Sy httpd
.Sq YES
or
.Sq NO .
Runs
.Xr httpd 8
daemon and passes
.Sy httpd_flags .
.It Sy httpd_wwwdir
A string.
The
.Xr httpd 8
WWW root directory.
Used only if
.Sy httpd
is set to
.Sq YES .
The default setting is
.Dq Pa /var/www .
.It Sy httpd_wwwuser
A string.
If non-blank and
.Sy httpd
is
.Sq YES ,
run
.Xr httpd 8
and cause it to switch to the specified user and the groups of the
user after initialization.
It is preferred to
.Sy httpd_user
because
.Xr httpd 8
is requiring extra privileges to start listen on default port 80.
The default setting is
.Dq Dv _httpd .
.It Sy lpd
.Sq YES
or

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: postinstall,v 1.79 2008/12/05 19:01:23 cube Exp $
# $NetBSD: postinstall,v 1.80 2008/12/11 13:55:17 mishka Exp $
#
# Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -953,7 +953,7 @@ do_rc()
ccd cgd cleartmp cron \
dhclient dhcpd dhcrelay dmesg downinterfaces envsys \
fsck ftp_proxy ftpd \
hostapd \
hostapd httpd \
identd ifwatchd inetd ipfilter ipfs ipmon ipnat ipsec \
irdaattach iscsi_target isdnd \
kdc \