man-pages/man3/DebianNet.3.html
2021-03-31 01:06:50 +01:00

209 lines
4.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of DebianNet</TITLE>
</HEAD><BODY>
<H1>DebianNet</H1>
Section: User Contributed Perl Documentation (3)<BR>Updated: 2019-03-05<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
DebianNet - create, remove, enable or disable entry in /etc/inetd.
<A NAME="lbAC">&nbsp;</A>
<H2>DESCRIPTION</H2>
You can use the functions in <B>DebianNet</B> to to add, remove, enable or
disable entries in the <I>/etc/inetd.conf</I> file. After the <I>/etc/inetd.conf</I>
file has been changed, a <B></B><FONT SIZE="-1"><B>SIGHUP</B></FONT><B></B> signal will be sent to the inetd
process to make sure that inetd will use the new <I>/etc/inetd.conf</I> file.
The functions can also be used to add entries that are commented out by
default. They will be treated like normal entries. That also means that
if you already have an entry that is commented out you can't add an entry
for the same service without removing the old one first.
<P>
The <B>DebianNet</B> functions treat entries that are commented out by a
single '<B>#</B>' character as entries that have been commented out by a
user. It will not change such entries.
<P>
For shell scripts you can also use the <B>update-inetd</B> command. See
<B><A HREF="/cgi-bin/man/man2html?8+update-inetd">update-inetd</A></B>(8) for further information.
<A NAME="lbAD">&nbsp;</A>
<H2>VARIABLES</H2>
<DL COMPACT>
<DT id="1">$DebianNet::INETD_CONF<DD>
Contains a scalar filename to use as the inetd config file (e.g. for
testing purposes).
<P>
Defaults to <I>/etc/inetd.conf</I>.
<DT id="2">$DebianNet::SEP<DD>
Contains the entry comment characters. This is only necessary if you have
to deal with two (or more) services of the same name.
<P>
Defaults to &quot;<B>#&lt;off&gt;# </B>&quot; as the comment characters.
<DT id="3">$DebianNet::MULTI<DD>
Contains a boolean that decides whether to disable/remove more than one
entry at a time. If you try to remove more than one entry at a time without
using this option the program will show a warning and will ask the user
whether to continue.
<P>
Defaults to false.
<DT id="4">$DebianNet::VERBOSE<DD>
Contains a boolean to select whether to explain verbosely what is being
done.
<P>
Defaults to false.
</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>FUNCTIONS</H2>
<DL COMPACT>
<DT id="5">$rc = DebianNet::add_service($newentry, $group)<DD>
Add <TT>$newentry</TT> to the group <TT>$group</TT> of the <I>/etc/inetd.conf</I> file. If the
entry already exist it will be enabled (it will also detect entries with
different program options). Using <TT>$group</TT> is optional (the default group
is the group <FONT SIZE="-1">OTHER</FONT>). If the group does not exist the entry will be placed
at the end of the file.
<P>
Returns 1 on success, and -1 on failure. This function might call <B>exit</B>()
due to debconf prompt answers.
<DT id="6">$rc = DebianNet::remove_service($entry)<DD>
Remove <TT>$entry</TT> from <I>/etc/inetd.conf</I>. You can use a regular expression
to remove the entry.
<P>
Returns 1 on success, and -1 on failure.
<DT id="7">$rc = DebianNet::disable_service($service, $pattern)<DD>
Disable <TT>$service</TT> (e.g. &quot;<I>ftp</I>&quot;) in <I>/etc/inetd.conf</I>. Using <TT>$pattern</TT> is
optional (see <B>enable_service()</B>).
<P>
Returns 1 on success, and -1 on failure.
<DT id="8">$rc = DebianNet::enable_service($service, $pattern)<DD>
Enable <TT>$service</TT> (e.g. &quot;<I>ftp</I>&quot;) in <I>/etc/inetd.conf</I>. Using <TT>$pattern</TT> is
optional. It can be used to select a service. You only need this option
if you have two (or more) services of the same name.
<P>
An example: you have three <I>ftp</I> entries in the <I>/etc/inetd.conf</I> file
(all disabled by default) and you want to enable the entry which uses the
<I>vsftpd</I> daemon. To do this, use the pattern &quot;<I>vsftpd</I>&quot; (or any other
regular expression that matches this entry).
<P>
Returns 1 on success, and -1 on failure.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>CHANGES</H2>
<A NAME="lbAG">&nbsp;</A>
<H3>Version 1.13</H3>
New variables: <TT>$VERSION</TT>, <TT>$VERBOSE</TT>, <TT>$MULTI</TT>, <TT>$SEP</TT>, <TT>$INETD_CONF</TT>.
<P>
Deprecated variables: <TT>$version</TT>, <TT>$verbose</TT>, <TT>$multi</TT>, <TT>$sep</TT>, <TT>$inetdcf</TT>.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="9"><A HREF="#lbAB">NAME</A><DD>
<DT id="10"><A HREF="#lbAC">DESCRIPTION</A><DD>
<DT id="11"><A HREF="#lbAD">VARIABLES</A><DD>
<DT id="12"><A HREF="#lbAE">FUNCTIONS</A><DD>
<DT id="13"><A HREF="#lbAF">CHANGES</A><DD>
<DL>
<DT id="14"><A HREF="#lbAG">Version 1.13</A><DD>
</DL>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:38 GMT, March 31, 2021
</BODY>
</HTML>