OSSP CVS Repository

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

Check-in Number: 1760
Date: 2002-Jan-31 17:31:24 (local)
2002-Jan-31 16:31:24 (UTC)
User:ms
Branch:
Comment: Added common section, but mostly cleanup work.

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

Tickets:
Inspections:
Files:
ossp-pkg/rc/rc.example      1.3 -> 1.4     56 inserted, 37 deleted

ossp-pkg/rc/rc.example 1.3 -> 1.4

--- rc.example   2002/01/30 22:55:26     1.3
+++ rc.example   2002/01/31 16:31:24     1.4
@@ -1,29 +1,32 @@
 ##
-##  rc.example
+##  rc.example - rcfile template
 ##
-##  Examines different ways of writing run commands for a program.
-##  If used in production, this file would be different. It would
-##  have a name like 'rc.helloworld' and contain run commands for
-##  the 'helloworld' program. It would also have only one notation.
-##  A sample is repeated in this document using rc (native), XML,
-##  and ASN.1 notation. The same rcfile semantics are repeated only
-##  to show what is possible through the abstract syntax offered by
-##  OSSP rc.
-##
-##  To learn what regular expressions must be used with the example
-##  example syntaxes in this document, refer to the rc.conf file
-##  included with the original OSSP rc distribution. It has the
-##  corresponding regular expressions settings.
+##  This file examines different ways of writing runcommands for a     ##
+##  program.  If used in production, this file would be different.  It ##
+##  would have a name like 'rc.helloworld' and contain runcommands     ##
+##  for the 'helloworld' program. It would also have only one          ##
+##  notation. A sample is repeated in this document using rc (native), ##
+##  XML, and ASN.1 notation. The same rcfile semantics are repeated    ##
+##  only to show what is possible through the abstract syntax offered  ##
+##  by OSSP rc.                                                        ##
+##                                                                     ##
+##  To learn what regular expressions to use with the example          ##
+##  example syntaxes in this document, refer to the rc.conf file       ##
+##  included with the original OSSP rc distribution. It has the        ##
+##  corresponding regular expressions settings.                        ##
+##                                                                     ##
 
-# Generic run commands for example daemon. Using native #
-# rc default symbols and conventional identifiers.      #
+# Generic runcommands for example daemon. Using #
+# default symbols and conventional identifiers. #
 
 %confvars
     sftpd_enable="yes"
-    sftpd_interpreter="/usr/bin/sh"
     sftpd_anonymous="yes"
     sftpd_flags=""
 
+%common
+    timeStamp   # Function from rc.func library
+
 %start -p 200 -u root
     /usr/local/sbin/sftpd -c
 
@@ -34,24 +37,28 @@
     kill -HUP `cat /var/sftp/run/sftpd.pid` 
 
 %restart -u root
-    @stop       # reference to term section
+    @stop       # Reference to term section
     sleep 2
-    @start      # reference to start section
+    @start      # Reference to start section
 
 %status -c /usr/bin/perl
     print STDERR "Sftpd status report";
     for ...
+# End stock syntax example rcfile
+
 
-# Generic run commands for example daemon. Using #
+# Generic runcommands for example daemon. Using  #
 # custom symbols and unconventional identifiers. #
 
 !confvars
     sftpd_enable="yes"
-    sftpd_interpreter="/usr/bin/sh"
     sftpd_anonymous="yes"
     sftpd_flags=""
 
-!start -p 200 -u root
+!prependwith
+    timeStamp   # Function from rc.func library
+
+!run -p 200 -u root
     /usr/local/sbin/sftpd -c
 
 !term -p 200 -u root
@@ -60,25 +67,30 @@
 !hangup -u root
     kill -HUP `cat /var/sftp/run/sftpd.pid` 
 
-!restart -u root
-    &term       # reference to term section
+!termrun -u root
+    &term       # Reference to term section
     sleep 2
-    &start      # reference to start section
+    &start      # Reference to start section
 
-!status -c /usr/bin/perl
+!printstat -c /usr/bin/perl
     print STDERR "Sftpd status report";
     for ...
+# End custom syntax example rcfile
+
 
-# Generic run commands for example daemon. Using an #
-# XML-like syntax and conventional identifiers.     #
+# Generic runcommands for example daemon. Using an #
+# XML-like syntax and conventional identifiers.    #
 
 <config>
     <set name=sftpd_enable>"yes"</set>
-    <set name=sftpd_interpreter>"/usr/bin/sh"</set>
     <set name=sftpd_anonymous>"yes"</set>
     <set name=sftpd_flags>""</set>
 </config>
 
+<common>
+    timeStamp   # Function from rc.func library
+</common>
+
 <start pri=200 user=root>
     /usr/local/sbin/sftpd -c
 </start>
@@ -92,27 +104,33 @@
 </reload>
 
 <restart user=root>
-    <refer name=stop>   # reference to term section
+    <refer name=stop>   # Reference to term section
     sleep 2
-    <refer name=start>  # reference to start section
+    <refer name=start>  # Reference to start section
 </restart>
 
 <status pri=100 interpreter=/usr/bin/perl>
     print STDERR "Sftpd status report";
     for ...
 </status>
+# End XML-like syntax example rcfile
 
-# Generic run commands for example daemon. Using a #
-# ASN.1-like syntax and conventional identifiers.  #
+
+# Generic runcommands for example daemon. Using a #
+# ASN.1-like syntax and conventional identifiers. #
 
 config CONFIG
     BEGIN
         sftpd_enable STRING ::= "yes"
-        sftpd_interpreter STRING ::= "/usr/bin/sh"
         sftpd_anonymous STRING ::= "yes"
         sftpd_flags STRING ::= ""
     END
 
+common COMMON
+    BEGIN
+        timeStamp   # Function from rc.func library
+    END
+
 start SECTION ::= {
     priority INTEGER ::= 200
     user STRING ::= "root"
@@ -140,12 +158,12 @@
     user STRING ::= "root"
 }
     BEGIN
-        stop REFER      # reference to term section
+        stop REFER  # Reference to term section
         sleep 2
-        start REFER     # reference to start section
+        start REFER # Reference to start section
     END
 
-restart SECTION ::= {
+status SECTION ::= {
     priority INTEGER ::= 100
     interpreter STRING ::= "/usr/bin/perl"
 }
@@ -153,3 +171,4 @@
         print STDERR "Sftpd status report";
         for ...
     END
+# End ASN.1-like syntax example rcfile

CVSTrac 2.0.1