Automatically generated by Pod::Man v1.37, Pod::Parser v1.13 Standard preamble: ========================================================================
\\$1
..
..
..
..
Set up some character translations and predefined strings. \*(-- will give an unbreakable dash, \*(PI will give pi, \*(L" will give a left double quote, and \*(R" will give a right double quote. | will give a real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to do unbreakable dashes and therefore won't be available. \*(C` and \*(C' expand to `' in nroff, nothing in troff, for use with C<>..tr \(*W-|\(bv\*(Tr
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
If the F register is turned on, we'll generate index entries on stderr for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index entries marked with X<> in POD. Of course, you'll have to process the output yourself in some meaningful fashion.. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
For nroff, turn off justification. Always turn off hyphenation; it makes way too many mistakes in technical documents. Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). Fear. Run. Save yourself. No user-serviceable parts.. \" fudge factors for nroff and troff
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #]
.\}
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
. \" corrections for vroff
. \" for low resolution devices (crt and lpr)
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
======================================================================== Title "Sudoscript 3pm" Sudoscript 3pm "2004-05-30" "perl v5.8.1" "User Contributed Perl Documentation"
"NAME"
Sudoscript.pm
"SYNOPSIS"
Header "SYNOPSIS" .Vb 3
use Sudoscript;
my $ss=Sudoscript->new();
.. do stuff with $ss
.Ve
"DESCRIPTION"
Header "DESCRIPTION" A module to implement some common attributes and methods
shared between sudoshell and sudoscriptd. See
sudoscript\|(8),
\fIsudoscriptd\|(8) and
sudoshell\|(1) for descriptions of the sudoscript system.
This module implements routines that
"\(bu" 4
Set up the execution environment based on the running \s-1OS\s0
"\(bu" 4
Return command names with switches tuned for the running \s-1OS\s0
"\(bu" 4
Check to see if sudoscriptd is running
"\(bu" 4
Return date stamp strings in one of several formats
"\(bu" 4
Close standard I/O channels for daemons, redirecting \s-1STDERR\s0 to log files.
The following sections docment these routimnes more fully.
"Constructor"
Header "Constructor" The constructor is called
new(). It does the usual \s-1OO\s0 style initialization, then returns the
result of calling
_init();
The _init() routine:
"\(bu" 4
Initializes the local time zone names
"\(bu" 4
Sets a safe execution path
"\(bu" 4
Checks the \s-1OS\s0 type of the running system
"\(bu" 4
Sets up some shell commands based on the \s-1OS\s0 type
"\(bu" 4
Returns its
$self if it recognized the \s-1OS\s0, or undef otherwise
"Command Properties"
Header "Command Properties" These properties return unqualified command names with switches, when they appear,
appropriate for the running \s-1OS\s0. (Since
_init() sets the execution path, we do not
fully qualify the paths to these commands.)
.Sh "\s-1
SUDO\s0()"
Subsection "SUDO()" The
sudo\|(8) command without any switches
.Sh "\s-1
GREP\s0()"
Subsection "GREP()" The
grep\|(1) command, without any switches
.Sh "\s-1
PS\s0()"
Subsection "PS()" The
ps\|(1) command with switches that produce a listing parseable by
checkpid()
.Sh "\s-1
INITSCR\s0()"
Subsection "INITSCR()" .Vb 1
The complete path to the sudoscriptd init script
.Ve
.Sh "\s-1
SCRIPT\s0()"
Subsection "SCRIPT()" The
script\|(1) command. On Linux, this will have the -q switch added.
.Sh "\s-1
TZNAMES\s0()"
Subsection "TZNAMES()" The local time zone names set up by
_init()
"Methods"
Header "Methods" .Sh "
check_ssd()"
Subsection "check_ssd()" This method checks to see if sudoscriptd is running (via
checkpid())
If not, it offers to start it, and gives some helpful advice regarding starting sudoscriptd
at boot time. It also tells the user they need root sudo privilege to successfully start
sudoscriptd. The method then looks for the sudoscriptd init script set up
by
_init(). If that script is not found, or is not executable, the method prompts for
an init script path to use. It then attempts to start the daemon. The method sleeps for
three seconds and then checks again for sudoscriptd with
checkpid(). If the daemon
still isn't running, the method
dies, taking the caller with it.
.Sh "
checkpid()"
Subsection "checkpid()" This method gets the \s-1PID\s0 of the current sudoscriptd out of /
var/
run/
sudoscriptd.pid,
if there is such a file. It looks for the \s-1PID\s0 in the process list
If there is such a process, and its name contains 'sudoscriptd', the
method returns the \s-1PID\s0. Otherwise, it returns 0.
.Sh "
datestamp()"
Subsection "datestamp()" This method returns a date stamp string in one of three formats,
depending on the passed parameter.
These are:
"long" 4
Item "long" wdy mon dd hh:mm:ss \s-1TZ\s0 yyyy
"sortable" 4
Item "sortable" yyyymoddhhmmss
"anything else" 4
Item "anything else" wdy mon dd hh:mm:ss
.Vb 1
Where:
.Ve
.Vb 9
wdy = week day name
mon = three letter month name
TZ = three letter time zone name (e.g. 'PST')
yyyy = four digit year
mo = two digit month number
dd = two digit day of month
hh = two digit hour
mm = two digit minute
ss = two digit second
.Ve
.Sh "daemon_io()"
Subsection "daemon_io()" This method closes \s-1STDIN\s0 and \s-1STDOUT\s0, and redirects \s-1STDERR\s0 to a file named:
.Vb 1
/var/run/sudoscriptd/stderr$tag
.Ve
Where $tag is a string passed to the method. There are commonly three, but sometimes
two or four types of daemons running at all times in the sudoscript system. Each of them
calls daemon_io() and each gets a seperate (per daemon type) stderr log. These are
are overwritten on the next sudoscriptd startup.
"SEE ALSO"
Header "SEE ALSO" \fIsudoscript\|(8)
\fIsudoscriptd\|(8)
\fIsudoshell\|(1)
\fIsudo\|(8)
\fIsudoers\|(5)
http://www.egbok.com/sudoscript
"AUTHOR"
Header "AUTHOR" Howard Owen, <hbo@egbok.com>
"COPYRIGHT AND LICENSE"
Header "COPYRIGHT AND LICENSE" Copyright 2003 by Howard Owen
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.