We should use -feature instead of nofeature.

This matches the ifconfig and Gentoo USE flag syntax and is hopefully
easier to read.
Fixes #178.
This commit is contained in:
Roy Marples 2009-07-01 00:07:32 +01:00
parent 6abeec7430
commit b4104957b1
48 changed files with 82 additions and 69 deletions

View File

@ -14,7 +14,7 @@ depend()
use logger use logger
after bootmisc modules after bootmisc modules
before dns dhcpcd net before dns dhcpcd net
keyword noshutdown keyword -shutdown
} }
find_wireless() find_wireless()

View File

@ -22,7 +22,7 @@ depend()
[ "$clock" != "UTC" -a ! -e /etc/wall_cmos_clock ]; then [ "$clock" != "UTC" -a ! -e /etc/wall_cmos_clock ]; then
need root need root
fi fi
keyword nojail noprefix keyword -jail -prefix
} }
start() start()

View File

@ -8,7 +8,7 @@ depend()
need localmount need localmount
before logger before logger
after clock sysctl after clock sysctl
keyword noprefix keyword -prefix
} }
dir_writeable() dir_writeable()

View File

@ -8,7 +8,7 @@ depend()
{ {
need localmount termencoding need localmount termencoding
after hotplug bootmisc after hotplug bootmisc
keyword noopenvz noprefix nouml novserver noxenu keyword -openvz -prefix -uml -vserver -xenu
} }
start() start()

View File

@ -10,7 +10,7 @@ depend() {
need localmount need localmount
after bootmisc after bootmisc
before net.lo0 before net.lo0
keyword nojail noprefix keyword -jail -prefix
} }
start_pre() { start_pre() {

View File

@ -6,7 +6,7 @@ description="Mount system critical filesystems in /dev."
depend() { depend() {
use dev use dev
keyword noprefix novserver keyword -prefix -vserver
} }
start() { start() {

View File

@ -7,7 +7,7 @@ description="Set the dmesg level for a cleaner boot"
depend() depend()
{ {
before dev modules before dev modules
keyword novserver keyword -vserver
} }
start() start()

View File

@ -6,7 +6,7 @@ description="Configures a specific kernel dump device."
depend() { depend() {
need swap need swap
keyword nojail noprefix keyword -jail -prefix
} }
start() { start() {

View File

@ -9,7 +9,7 @@ _IFS="
depend() depend()
{ {
use dev clock modules use dev clock modules
keyword nojail noopenvz noprefix notimeout novserver keyword -jail -openvz -prefix -timeout -vserver
} }
_abort() { _abort() {

View File

@ -9,7 +9,7 @@ depend()
{ {
use root use root
before devd net before devd net
keyword nojail noprefix keyword -jail -prefix
} }
_set() _set()

View File

@ -5,7 +5,7 @@
description="Sets the hostname of the machine." description="Sets the hostname of the machine."
depend() { depend() {
keyword noprefix keyword -prefix
} }
start() start()

View File

@ -28,7 +28,7 @@ depend()
else else
before * before *
fi fi
keyword noopenvz noprefix nouml novserver noxenu keyword -openvz -prefix -uml -vserver -xenu
} }
setupopts() setupopts()

View File

@ -13,7 +13,7 @@ opts="panic showstatus"
depend() { depend() {
before net before net
provide firewall provide firewall
keyword nojail keyword -jail
} }
ipfw() { ipfw() {

View File

@ -8,7 +8,7 @@ depend()
{ {
need localmount termencoding need localmount termencoding
after bootmisc after bootmisc
keyword noopenvz noprefix nouml novserver noxenu keyword -openvz -prefix -uml -vserver -xenu
} }
start() start()

View File

@ -6,7 +6,7 @@ description="Kill all processes so we can unmount disks cleanly."
depend() depend()
{ {
keyword noprefix keyword -prefix
} }
start() start()

View File

@ -7,7 +7,7 @@ description="Executes user commands in /etc/conf.d/local"
depend() depend()
{ {
after * after *
keyword notimeout keyword -timeout
} }
start() start()

View File

@ -8,7 +8,7 @@ depend()
{ {
need fsck need fsck
use lvm modules mtab use lvm modules mtab
keyword nojail noopenvz noprefix novserver keyword -jail -openvz -prefix -vserver
} }
start() start()

View File

@ -7,7 +7,7 @@ extra_commands="restore"
depend() depend()
{ {
need localmount need localmount
keyword nojail noprefix keyword -jail -prefix
} }
restore() restore()

View File

@ -7,7 +7,7 @@ description="Loads a user defined list of kernel modules."
depend() depend()
{ {
use isapnp use isapnp
keyword noopenvz noprefix novserver keyword -openvz -prefix -vserver
} }
start() start()

View File

@ -7,7 +7,7 @@ description="Re-mount filesytems read-only for a clean reboot."
depend() depend()
{ {
need killprocs savecache need killprocs savecache
keyword noprefix noopenvz novserver keyword -prefix -openvz -vserver
} }
start() start()

View File

@ -16,7 +16,7 @@ depend()
{ {
need localmount need localmount
after bootmisc after bootmisc
keyword nojail noprefix keyword -jail -prefix
} }
start() start()

View File

@ -7,7 +7,7 @@ description="Update /etc/mtab to match what the kernel knows about"
depend() depend()
{ {
need root need root
keyword noprefix keyword -prefix
} }
start() start()

View File

@ -21,7 +21,7 @@ depend()
need localmount need localmount
after bootmisc after bootmisc
provide net provide net
keyword nojail noprefix novserver keyword -jail -prefix -vserver
case "${IFACE}" in case "${IFACE}" in
lo|lo0);; lo|lo0);;

View File

@ -35,7 +35,7 @@ depend()
need net $pmap need net $pmap
use afc-client amd autofs openvpn use afc-client amd autofs openvpn
use dns nfs nfsmount portmap rpcbind rpc.statd rpc.lockd use dns nfs nfsmount portmap rpcbind rpc.statd rpc.lockd
keyword nojail noprefix novserver keyword -jail -prefix -vserver
} }
start() start()

View File

@ -13,7 +13,7 @@ depend()
need localmount need localmount
after bootmisc after bootmisc
provide net provide net
keyword nojail noprefix novserver keyword -jail -prefix -vserver
} }
uniqify() uniqify()

View File

@ -7,7 +7,7 @@ required_files="/etc/newsyslog.conf"
depend() depend()
{ {
need localmount need localmount
keyword noprefix keyword -prefix
} }
start() start()

View File

@ -9,7 +9,7 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
depend() depend()
{ {
need localmount need localmount
keyword noopenvz noprefix novserver keyword -openvz -prefix -vserver
} }
_setleds() _setleds()

View File

@ -11,7 +11,7 @@ extra_started_commands="reload"
depend() { depend() {
need localmount need localmount
keyword nojail noprefix keyword -jail -prefix
} }
start() start()

View File

@ -12,7 +12,7 @@ depend()
need localmount need localmount
use logger use logger
after bootmisc after bootmisc
keyword nojail noprefix keyword -jail -prefix
} }
start_pre() start_pre()

View File

@ -8,7 +8,7 @@ depend()
{ {
use modules devfs use modules devfs
need localmount need localmount
keyword noopenvz noprefix novserver keyword -openvz -prefix -vserver
} }
start() start()

View File

@ -7,7 +7,7 @@ depend()
need localmount net need localmount net
after * after *
before local before local
keyword noprefix keyword -prefix
} }
start() start()

View File

@ -7,7 +7,7 @@ description="Mount the root fs read/write"
depend() depend()
{ {
need fsck need fsck
keyword nojail noopenvz noprefix novserver keyword -jail -openvz -prefix -vserver
} }
start() start()

View File

@ -7,7 +7,7 @@ description="Saves a kernel dump."
depend() depend()
{ {
need localmount need localmount
keyword nojail noprefix keyword -jail -prefix
} }
start() start()

View File

@ -5,7 +5,7 @@
depend() depend()
{ {
before fsck before fsck
keyword nojail noprefix keyword -jail -prefix
} }
start() start()

View File

@ -5,7 +5,7 @@
depend() depend()
{ {
need localmount need localmount
keyword nojail noopenvz noprefix novserver keyword -jail -openvz -prefix -vserver
} }
start() start()

View File

@ -4,7 +4,7 @@
depend() { depend() {
need localmount need localmount
keyword nojail noprefix keyword -jail -prefix
} }
start() { start() {

View File

@ -6,7 +6,7 @@ depend()
{ {
use hostname use hostname
before bootmisc logger before bootmisc logger
keyword noprefix keyword -prefix
} }
start() start()

View File

@ -6,7 +6,7 @@ depend()
{ {
use hostname use hostname
before bootmisc logger before bootmisc logger
keyword noopenvz noprefix novserver keyword -openvz -prefix -vserver
} }
start() start()

View File

@ -6,7 +6,7 @@ description="Mount the sys filesystem."
depend() depend()
{ {
keyword noprefix novserver keyword -prefix -vserver
} }
mount_sys() mount_sys()

View File

@ -16,5 +16,5 @@ depend()
use net newsyslog use net newsyslog
need localmount need localmount
after bootmisc after bootmisc
keyword noprefix keyword -prefix
} }

View File

@ -9,7 +9,7 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
depend() depend()
{ {
keyword noopenvz noprefix nouml novserver noxenu keyword -openvz -prefix -uml -vserver -xenu
} }
start() start()

View File

@ -5,7 +5,7 @@
depend() depend()
{ {
after fsck after fsck
keyword noprefix keyword -prefix
} }
start() start()

View File

@ -8,7 +8,7 @@ description="Initializes the random number generator."
depend() depend()
{ {
need localmount need localmount
keyword nojail noprefix keyword -jail -prefix
} }
save_seed() save_seed()

View File

@ -5,7 +5,7 @@
depend() depend()
{ {
need localmount need localmount
keyword noprefix keyword -prefix
} }
start() start()

View File

@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.Dd April 30, 2009 .Dd July 1, 2009
.Dt RUNSCRIPT 8 SMM .Dt RUNSCRIPT 8 SMM
.Os OpenRC .Os OpenRC
.Sh NAME .Sh NAME
@ -138,30 +138,30 @@ We should recalculate our dependencies if the listed files have changed.
.It Ic keyword .It Ic keyword
Tags a service with a keyword. Here's the keywords we currently understand:- Tags a service with a keyword. Here's the keywords we currently understand:-
.Bl -tag -width indent .Bl -tag -width indent
.It Dv nojail .It Dv -jail
When in a jail, exclude this service from any dependencies. The service can When in a jail, exclude this service from any dependencies. The service can
still be run directly. still be run directly.
.It Dv noopenvz .It Dv -openvz
Same as nojail, but for OpenVZ systems. Same as -jail, but for OpenVZ systems.
.It Dv noshutdown .It Dv -shutdown
Don't stop this service when shutting the system down. Don't stop this service when shutting the system down.
This normally quite safe as remaining daemons will be sent a SIGTERM just This normally quite safe as remaining daemons will be sent a SIGTERM just
before final shutdown. before final shutdown.
Network related services such as the network and dhcpcd init scripts normally Network related services such as the network and dhcpcd init scripts normally
have this keyword. have this keyword.
.It Dv nostop .It Dv -stop
Don't stop this service when changing runlevels, even if not present. Don't stop this service when changing runlevels, even if not present.
This includes shutting the system down. This includes shutting the system down.
.It Dv notimeout .It Dv -timeout
Do not time out waiting for that service. Do not time out waiting for that service.
.It Dv nouml .It Dv -uml
Same as nojail, but for UML systems. Same as -jail, but for UML systems.
.It Dv novserver .It Dv -vserver
Same as nojail, but for VServer systems. Same as -jail, but for VServer systems.
.It Dv noxen0 .It Dv -xen0
Same as nojail, but for Xen DOM0 systems. Same as -jail, but for Xen DOM0 systems.
.It Dv noxenu .It Dv -xenu
Same as nojail, but for Xen DOMU systems. Same as -jail, but for Xen DOMU systems.
.El .El
.El .El
.Pp .Pp

View File

@ -738,7 +738,7 @@ rc_deptree_update(void)
RC_STRING *s, *s2, *s2_np, *s3, *s4; RC_STRING *s, *s2, *s2_np, *s3, *s4;
char *line = NULL; char *line = NULL;
size_t len = 0; size_t len = 0;
char *depend, *depends, *service, *type, *nosys; char *depend, *depends, *service, *type, *nosys, *onosys;
size_t i, k, l; size_t i, k, l;
bool retval = true; bool retval = true;
const char *sys = rc_sys(); const char *sys = rc_sys();
@ -841,17 +841,25 @@ rc_deptree_update(void)
* work for them. This doesn't stop them from being run directly. */ * work for them. This doesn't stop them from being run directly. */
if (sys) { if (sys) {
len = strlen(sys); len = strlen(sys);
nosys = xmalloc(len + 3); nosys = xmalloc(len + 1);
nosys[0] = 'n'; nosys[0] = '-';
nosys[1] = 'o';
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
nosys[i + 2] = (char)tolower((unsigned char)sys[i]); nosys[i + 1] = (char)tolower((unsigned char)sys[i]);
nosys[i + 2] = '\0'; nosys[i + 1] = '\0';
onosys = xmalloc(len + 3);
onosys[0] = 'n';
onosys[1] = 'o';
for (i = 0; i < len; i++)
onosys[i + 2] = (char)tolower((unsigned char)sys[i]);
onosys[i + 2] = '\0';
TAILQ_FOREACH_SAFE(depinfo, deptree, entries, depinfo_np) TAILQ_FOREACH_SAFE(depinfo, deptree, entries, depinfo_np)
if ((deptype = get_deptype(depinfo, "keyword"))) if ((deptype = get_deptype(depinfo, "keyword")))
TAILQ_FOREACH(s, deptype->services, entries) TAILQ_FOREACH(s, deptype->services, entries)
if (strcmp(s->value, nosys) == 0) { if (strcmp(s->value, nosys) == 0 ||
strcmp(s->value, onosys) == 0)
{
provide = get_deptype(depinfo, "iprovide"); provide = get_deptype(depinfo, "iprovide");
TAILQ_REMOVE(deptree, depinfo, entries); TAILQ_REMOVE(deptree, depinfo, entries);
TAILQ_FOREACH(di, deptree, entries) { TAILQ_FOREACH(di, deptree, entries) {
@ -870,6 +878,7 @@ rc_deptree_update(void)
} }
} }
free(nosys); free(nosys);
free(onosys);
} }
/* Phase 3 - add our providers to the tree */ /* Phase 3 - add our providers to the tree */

View File

@ -600,8 +600,11 @@ do_stop_services(const char *newlevel, bool parallel, bool going_down)
continue; continue;
} }
kwords = rc_deptree_depend(deptree, service->value, "keyword"); kwords = rc_deptree_depend(deptree, service->value, "keyword");
if (rc_stringlist_find(kwords, "nostop") || if (rc_stringlist_find(kwords, "-stop") ||
(going_down && rc_stringlist_find(kwords, "noshutdown"))) rc_stringlist_find(kwords, "nostop") ||
(going_down &&
(rc_stringlist_find(kwords, "-shutdown") ||
rc_stringlist_find(kwords, "noshutdown"))))
nstop = true; nstop = true;
else else
nstop = false; nstop = false;

View File

@ -471,7 +471,8 @@ svc_wait(const char *svc)
/* Some services don't have a timeout, like fsck */ /* Some services don't have a timeout, like fsck */
keywords = rc_deptree_depend(deptree, svc, "keyword"); keywords = rc_deptree_depend(deptree, svc, "keyword");
if (rc_stringlist_find(keywords, "notimeout")) if (rc_stringlist_find(keywords, "-timeout") ||
rc_stringlist_find(keywords, "notimeout"))
forever = true; forever = true;
rc_stringlist_free(keywords); rc_stringlist_free(keywords);