Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 153263 Details for
Bug 237436
add description support to chkconfig?
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
a demonstration of description support for chkconfig
chkconfig-1.3.3--desc.patch (text/plain), 3.85 KB, created by
Paul Bolle
on 2007-04-22 23:44:28 UTC
(
hide
)
Description:
a demonstration of description support for chkconfig
Filename:
MIME Type:
Creator:
Paul Bolle
Created:
2007-04-22 23:44:28 UTC
Size:
3.85 KB
patch
obsolete
>--- ../chkconfig-1.3.30/chkconfig.8.desc 2005-02-02 22:36:41.000000000 +0100 >+++ ../chkconfig-1.3.30/chkconfig.8 2007-04-22 21:01:49.000000000 +0200 >@@ -10,6 +10,8 @@ > .br > \fBchkconfig\fR \fB--del\fR \fIname\fR > .br >+\fBchkconfig\fR \fB--desc\fR \fIname\fR >+.br > \fBchkconfig\fR [\fB--level\fR \fIlevels\fR] \fIname\fR <\fBon\fR|\fBoff\fR|\fBreset\fR> > .br > \fBchkconfig\fR [\fB--level\fR \fIlevels\fR] \fIname\fR >@@ -28,10 +30,11 @@ > of the configuration information regarding what services \fIinit\fR > starts in a single location. > >-\fBchkconfig\fR has five distinct functions: adding new services for >+\fBchkconfig\fR has six distinct functions: adding new services for > management, removing services from management, listing the current > startup information for services, changing the startup information >-for services, and checking the startup state of a particular service. >+for services, displaying the description of a particular service, and >+checking the startup state of a particular service. > > When \fBchkconfig\fR is run without any options, it displays usage > information. If only a service name is given, it checks to see if >@@ -58,7 +61,7 @@ > > \fBchkconfig\fR also can manage xinetd scripts via the means > of xinetd.d configuration files. Note that only the >-\fBon\fR, \fBoff\fR, and \fB-\-list\fR commands are supported >+\fBon\fR, \fBoff\fR, \fB-\-desc\fR, and \fB-\-list\fR commands are supported > for xinetd.d services. > > .SH OPTIONS >@@ -89,6 +92,10 @@ > service, run \fBchkconfig \fIname\fR \fBoff\fR. > > .TP >+\fB-\-desc\fR \fIname\fR >+This option displays the description of service \fIname\fR. >+ >+.TP > \fB-\-list\fR \fIname\fR > This option lists all of the services which \fBchkconfig\fR knows about, > and whether they are stopped or started in each runlevel. If \fIname\fR >--- ../chkconfig-1.3.30/chkconfig.c.desc 2006-09-07 20:58:40.000000000 +0200 >+++ ../chkconfig-1.3.30/chkconfig.c 2007-04-22 10:32:46.000000000 +0200 >@@ -35,6 +35,7 @@ > fprintf(stderr, _("usage: %s --list [name]\n"), progname); > fprintf(stderr, _(" %s --add <name>\n"), progname); > fprintf(stderr, _(" %s --del <name>\n"), progname); >+ fprintf(stderr, _(" %s --desc <name>\n"), progname); > fprintf(stderr, _(" %s [--level <levels>] <name> %s\n"), progname, "<on|off|reset|resetpriorities>"); > > exit(1); >@@ -284,6 +285,20 @@ > return 0; > } > >+static int descService(char * name) { >+ int rc; >+ struct service s; >+ >+ if ((rc = readServiceInfo(name, &s, 0))) { >+ readServiceError(rc, name); >+ return 1; >+ } >+ >+ printf("%-15s\t%s\n", s.name, s.desc); >+ >+ return 0; >+} >+ > static int isXinetdEnabled() { > int i; > struct service s; >@@ -478,7 +493,7 @@ > } > > int main(int argc, char ** argv) { >- int listItem = 0, addItem = 0, delItem = 0; >+ int listItem = 0, addItem = 0, delItem = 0, descItem = 0; > int rc, i, x; > int LSB = 0; > char * levels = NULL; >@@ -488,6 +503,7 @@ > struct poptOption optionsTable[] = { > { "add", '\0', 0, &addItem, 0 }, > { "del", '\0', 0, &delItem, 0 }, >+ { "desc", '\0', 0, &descItem, 0 }, > { "list", '\0', 0, &listItem, 0 }, > { "level", '\0', POPT_ARG_STRING, &levels, 0 }, > { "levels", '\0', POPT_ARG_STRING, &levels, 0 }, >@@ -530,8 +547,8 @@ > > if (help || argc == 1) usage(); > >- if ((listItem + addItem + delItem) > 1) { >- fprintf(stderr, _("only one of --list, --add, or --del may be " >+ if ((listItem + addItem + delItem + descItem) > 1) { >+ fprintf(stderr, _("only one of --list, --desc, --add, or --del may be " > "specified\n")); > exit(1); > } >@@ -553,6 +570,12 @@ > if (LSB) > name = basename(name); > return delService(name); >+ } else if (descItem) { >+ char * item = (char *)poptGetArg(optCon); >+ >+ if (!item || !*item || poptGetArg(optCon)) usage(); >+ >+ return descService(item); > } else if (listItem) { > char * item = (char *)poptGetArg(optCon); >
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 237436
: 153263