Index: ossp-pkg/rc/00TODO RCS File: /v/ossp/cvs/ossp-pkg/rc/00TODO,v rcsdiff -q -kk '-r1.8' '-r1.9' -u '/v/ossp/cvs/ossp-pkg/rc/00TODO,v' 2>/dev/null --- 00TODO 2002/01/24 17:47:47 1.8 +++ 00TODO 2002/01/25 16:04:41 1.9 @@ -13,8 +13,15 @@ If a variable is defined for which no default exists, warn user (Scholli.) Avoid a silent failure when giving non-existent run commands (Marcus.) +Possible problems + Abstract syntax of rc.file identifiers + Need to recognize language syntax, i.e. set, block von XML? + Is a regex enough to describe a syntax or do we need more? + Cases XML, M4, asn.1, ... + Automated environment - Solve problem discussed at OpenPKG eval meeting. + Stock rc.func includes AddPath, DelPath, PermMask. + Reccommended .bashrc includes rcEnter() and rcExit(). Error handling Classic error, give 'restart' command in place of 'start' to stopped prog Index: ossp-pkg/rc/rc.conf RCS File: /v/ossp/cvs/ossp-pkg/rc/rc.conf,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/rc/rc.conf,v' 2>/dev/null --- rc.conf 2002/01/24 17:47:47 1.1 +++ rc.conf 2002/01/25 16:04:41 1.2 @@ -12,18 +12,18 @@ #silent debug #raw + defaultsection config #name for config section in rcfile commonsection common #name for common section in rcfile -refsymbol & #can be @ or any unreserved ASCII symbol rcfile 'rc.%s' #'rc.' followed by the program name rcumask 002 #mask checked against rcfile permissions deactivate OSSP_RC_DEACT #environment variable controls activation +interpreter /usr/bin/perl #command interpreter to use for script code -# The following regex options need explanation -regex-section '(?<=^|\n)%%%s\s*\n(.+?)(?=\n%\S+|$)' -regex-param '..' -regex-reference '(?<=^|\n)%%%s\s*(.+?)(?=\n|;)' -regex-config '(\s+)=(.*)$' +regex-sec '(?<=^|\n)%%%s\s*\n(.+?)(?=\n%\S+|$)' +regex-ref '(?<=^|\n)%%%s\s*(.+?)(?=\n|;)' +regex-assign '(\s+)=(.*)$' +regex-param '..' #needs explanation #### Exclusive options #### #help Index: ossp-pkg/rc/rc.example RCS File: /v/ossp/cvs/ossp-pkg/rc/rc.example,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/rc/rc.example,v' 2>/dev/null --- rc.example 2002/01/24 17:47:47 1.1 +++ rc.example 2002/01/25 16:04:41 1.2 @@ -2,11 +2,39 @@ ## rc.example ## -# Generic run commands for example daemon. # -# Using custom symbols and identifiers. # +# Generic run commands for example daemon. Using # +# default symbols and conventional identifiers. # + +%confvars + sftpd_enable="yes" + sftpd_interpreter="/usr/bin/sh" + sftpd_anonymous="yes" + sftpd_flags="" + +%start -p 200 -u root + /usr/local/sbin/sftpd -c + +%stop -p 200 -u root + kill -TERM `cat /var/sftp/run/sftpd.pid` + +%reload -u root + kill -HUP `cat /var/sftp/run/sftpd.pid` + +%restart -u root + @stop # reference to term section + sleep 2 + @start # reference to start section + +%status -c /usr/bin/perl + print STDERR "Sftpd status report"; + for ... + +# Generic run commands for example daemon. Using # +# custom symbols and unconventional identifiers. # !confvars sftpd_enable="yes" + sftpd_interpreter="/usr/bin/sh" sftpd_anonymous="yes" sftpd_flags="" @@ -24,25 +52,39 @@ sleep 2 &start # reference to start section +!status -c /usr/bin/perl + print STDERR "Sftpd status report"; + for ... + +# Generic run commands for example daemon. Using # +# abstract syntax and conventional identifiers. # + + + "yes" + "/usr/bin/sh" + "yes" + "" + -# Generic run commands for example daemon. # -# Using default symbols and identifiers. # - -%confvars - sftpd_enable="yes" - sftpd_anonymous="yes" - sftpd_flags="" - -%start -p 200 -u root + /usr/local/sbin/sftpd -c + -%term -p 200 -u root + kill -TERM `cat /var/sftp/run/sftpd.pid` + -%hangup -u root + kill -HUP `cat /var/sftp/run/sftpd.pid` + -%restart -u root - @term # reference to term section + + # reference to term section sleep 2 - @start # reference to start section + # reference to start section + + + + print STDERR "Sftpd status report"; + for ... +