OSSP CVS Repository

ossp - Check-in [1762]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1762
Date: 2002-Jan-31 20:34:53 (local)
2002-Jan-31 19:34:53 (UTC)
User:ms
Branch:
Comment: Add passed-in arguments, rc_errstring and rc_errcode, section aliases, and empty section bodies.

PR: Submitted by: Reviewed by: Approved by: Obtained from:

Tickets:
Inspections:
Files:
ossp-pkg/rc/rc.example      1.5 -> 1.6     46 inserted, 23 deleted

ossp-pkg/rc/rc.example 1.5 -> 1.6

--- rc.example   2002/01/31 16:38:01     1.5
+++ rc.example   2002/01/31 19:34:53     1.6
@@ -37,19 +37,23 @@
     kill -HUP `cat /var/sftp/run/sftpd.pid` 
 
 %restart -u root
-    @stop       # Reference to term section
-    sleep 2
-    @start      # Reference to start section
+    @stop           # Reference to term section
+    sleep ${nSleep} # Variable nSleep defined at the command line
+    @start          # Reference to start section
 
 %status -c /usr/bin/perl
     print STDERR "Sftpd status report";
     for ...
 
-%error # We have a rc (not user-level) error
+%init   # Empty section body to prevent %default from running, in
+        # case the user types rc 'rcfile' 'init' on the command line
+%go -u root
+    @start  # A section with just one reference is an alias
+
+%error  # We have a rc (not user-level) error
 # Very rough representation of built-in rc language
-    +syslogit DAEMON CRITICAL;
-    +if ${sftpd_error}
-        +outconsole ${sftpd_error};
+    +logit DAEMON CRITICAL;
+    +outconsole ${rc_errstring}; # rc_errcode is also available
     +outconsole "Runcommand-level error in line ";
     +lineno SCRIPT; # Not +lineno ABSOLUTE;
     +outconsole " of rcfile ";
@@ -82,19 +86,23 @@
     kill -HUP `cat /var/sftp/run/sftpd.pid` 
 
 !termrun -u root
-    &term       # Reference to term section
-    sleep 2
-    &start      # Reference to start section
+    &term           # Reference to term section
+    sleep ${nSleep} # Variable nSleep defined at the command line
+    &start          # Reference to start section
 
 !printstat -c /usr/bin/perl
     print STDERR "Sftpd status report";
     for ...
 
+!runit  # Empty section body to prevent !missing from running, in
+        # case the user types rc 'rcfile' 'runit' on the command line
+!doit -u root
+    &run    # A section with just one reference is an alias
+
 !problem # We have a rc (not user-level) error
 # Very rough representation of built-in rc language
-    +syslogit DAEMON CRITICAL;
-    +if ${sftpd_error}
-        +outconsole ${sftpd_error};
+    +logit DAEMON CRITICAL;
+    +outconsole ${rc_errstring}; # rc_errcode is also available
     +outconsole "Runcommand-level error in line ";
     +lineno SCRIPT; # Not +lineno ABSOLUTE;
     +outconsole " of rcfile ";
@@ -133,7 +141,7 @@
 
 <restart user=root>
     <refer name=stop>   # Reference to term section
-    sleep 2
+    sleep ${nSleep}     # Variable nSleep defined at the command line
     <refer name=start>  # Reference to start section
 </restart>
 
@@ -142,11 +150,16 @@
     for ...
 </status>
 
+<init user=root> # Empty section body to prevent <default> from running, in
+                 # case the user types rc 'rcfile' 'init' on the command line
+<go user=root>
+    <refer name=start> # A section with just one reference is an alias
+</go>
+
 <error> # We have a rc (not user-level) error
 # Very rough representation of built-in rc language
-    +syslogit DAEMON CRITICAL;
-    +if ${sftpd_error}
-        +outconsole ${sftpd_error};
+    +logit DAEMON CRITICAL;
+    +outconsole ${rc_errstring}; # rc_errcode is also available
     +outconsole "Runcommand-level error in line ";
     +lineno SCRIPT; # Not +lineno ABSOLUTE;
     +outconsole " of rcfile ";
@@ -202,9 +215,9 @@
     user STRING ::= "root"
 }
     BEGIN
-        stop REFER  # Reference to term section
-        sleep 2
-        start REFER # Reference to start section
+        stop REFER      # Reference to term section
+        sleep ${nSleep} # Variable nSleep defined at the command line
+        start REFER     # Reference to start section
     END
 
 status SECTION ::= {
@@ -216,12 +229,22 @@
         for ...
     END
 
+init SECTION ::= {} # Empty section body to prevent default from running, in
+    BEGIN           # case the user types rc 'rcfile' 'init' on the command line
+    END
+
+go SECTION ::= {
+    user STRING ::= "root"
+}
+    BEGIN
+        start REFER # A section with just one reference is an alias
+    END
+
 error ERROR # We have a rc (not user-level) error
 # Very rough representation of built-in rc language
     BEGIN
-        +syslogit DAEMON CRITICAL;
-        +if ${sftpd_error}
-            +outconsole ${sftpd_error};
+        +logit DAEMON CRITICAL;
+        +outconsole ${rc_errstring}; # rc_errcode is also available
         +outconsole "Runcommand-level error in line ";
         +lineno SCRIPT; # Not +lineno ABSOLUTE;
         +outconsole " of rcfile ";

CVSTrac 2.0.1