---
name: "Config::Inetd"
section: "3pm"
platform: "linux"
package: "libconfig-inetd-perl"
version: "0.25-1"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/Config::Inetd"
---

# Config::Inetd(3pm)

Config::Inetd - Interface inetd's configuration file

```
 use Config::Inetd;
```

```
 $inetd = Config::Inetd->new;
```

```
 if ($inetd->is_enabled(telnet => 'tcp')) {
     $inetd->disable(telnet => 'tcp');
 }
```

```
 print $inetd->dump_enabled;
 print $inetd->dump_disabled;
```

```
 print $inetd->{CONF}[6];
```

Config::Inetd is an interface to inetd's configuration file *inetd.conf*; it simplifies checking and setting the enabled/disabled state of services  and dumping them by their state.\
 **new**

```
 $inetd = Config::Inetd->new('/path/to/inetd.conf');
```

Omitting the path to inetd.conf, will cause the default */etc/inetd.conf*  to be used.\
 **is\_enabled** Checks whether a service is enlisted as enabled.

```
 $retval = $inetd->is_enabled($service => $protocol);
```

Returns 1 if the service is enlisted as enabled, 0 if enlisted as disabled,  undef if the service does not exist. \
 **enable** Enables a service.

```
 $retval = $inetd->enable($service => $protocol);
```

Returns 1 if the service has been enabled, 0 if no action has been taken. It is recommended to preceedingly run *is\_enabled()* to determine whether a  service is disabled.\
 **disable** Disables a service.

```
 $retval = $inetd->disable($service => $protocol);
```

Returns 1 if the service has been disabled, 0 if no action has been taken.  It is recommended to preceedingly run *is\_enabled()* to determine whether a  service is enabled.\
 **dump\_enabled** Dumps the enabled services.

```
 @dump = $inetd->dump_enabled;
```

Returns an array that consists of inetd configuration lines which are enabled  services.\
 **dump\_disabled** Dumps the disabled services.

```
 @dump = $inetd->dump_disabled;
```

Returns an array that consists of inetd configuration lines which are disabled  services. The inetd configuration file is tied as instance data (newlines are preserved);  it may be accessed via @{$inetd-\>{CONF}}. Tie::File, [*inetd*(8)](/inetd/8.md) Steven Schubiger \<schubiger@cpan.org\> This program is free software; you may redistribute it and/or  modify it under the same terms as Perl itself. See \<http://www.perl.com/perl/misc/Artistic.html\>
