Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 33055 Details for
Bug 44489
rc-update current: sync runlevel with current running services
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
rc-update-current.patch
rc-update-current.patch (text/plain), 2.33 KB, created by
Eldad Zack (RETIRED)
on 2004-06-10 14:51:21 UTC
(
hide
)
Description:
rc-update-current.patch
Filename:
MIME Type:
Creator:
Eldad Zack (RETIRED)
Created:
2004-06-10 14:51:21 UTC
Size:
2.33 KB
patch
obsolete
>--- /sbin/rc-update 2004-06-07 09:45:11.000000000 +0300 >+++ rc-update 2004-06-11 00:47:34.668083312 +0300 >@@ -1,7 +1,7 @@ > #!/bin/bash >-# Copyright 1999-2004 Gentoo Technologies, Inc. >+# Copyright 1999-2003 Gentoo Technologies, Inc. > # Distributed under the terms of the GNU General Public License v2 >-# $Header: /home/cvsroot/gentoo-src/rc-scripts/sbin/rc-update,v 1.17 2004/04/21 17:09:18 vapier Exp $ >+# $Header: /home/cvsroot/gentoo-src/rc-scripts/sbin/rc-update,v 1.16 2003/08/04 21:39:17 azarah Exp $ > > source /sbin/functions.sh > if [ "${EUID}" -ne 0 ] >@@ -12,11 +12,13 @@ > > usage() { > cat << FOO >-usage: rc-update -a|add script runlevel2 [runlevel2...] >+usage: rc-update -a|add script runlevel1 [runlevel2...] > rc-update -d|del script [runlevel1...] > rc-update -s|show [runlevel1...] >+ rc-update -c|current [runlevel] > >-note: After rc-update executes, the script dependency cache is automatically >+note: >+ After rc-update executes, the script dependency cache is automatically > updated. > > examples: >@@ -36,6 +38,12 @@ > rc-update show > Show all the available scripts and list at which runlevels they > will execute. >+ >+ rc-update current default >+ Synchornize current running services with the "default" runlevel, >+ creating "default" if it doesn't exist. >+ use without any argument to sync to current runlevel. >+ > FOO > exit 1 > } >@@ -157,6 +165,50 @@ > done > } > >+current() { >+ >+ local x= >+ local mylevel= >+ >+ shift >+ if [ $# -eq 0 ] >+ then >+ mylevel=$(cat /var/lib/init.d/softlevel) >+ ewarn "Using current runlevel: ${mylevel}" >+ echo >+ else >+ mylevel=$1 >+ fi >+ >+ if [ ! -e "/etc/runlevels/${mylevel}" ] >+ then >+ einfo Creating runlevel ${mylevel} >+ echo >+ mkdir "/etc/runlevels/${mylevel}" >+ fi >+ >+ # Scan current started services and add them to current runlevel >+ >+ for x in $( cd /var/lib/init.d/started/ ; ls ) >+ do >+ if [ ! -L "/etc/runlevels/${mylevel}/${x}" ] >+ then >+ add shift ${x} ${mylevel} >+ fi >+ done >+ >+ # Scan current runlevel for non-running services, and remove them >+ >+ for x in $( cd /etc/runlevels/${mylevel} ; ls ) >+ do >+ if [ ! -L "/var/lib/init.d/started/${x}" ] >+ then >+ del shift ${x} ${mylevel} >+ fi >+ done >+ >+} >+ > if [ $# -lt 1 ] > then > usage >@@ -175,6 +227,9 @@ > show|-s) > show "$@" > ;; >+ current|-c) >+ current "$@" >+ ;; > *) > usage > exit 1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 44489
:
27261
|
27262
| 33055 |
33056