DebianNet(3)

πŸ“¦ version 4.51, in ubuntu jammy

πŸ’– DebianNet(3) β€” the perl module that runs your inetd.conf πŸ’–

okay bestie, welcome to the User Contributed Perl Documentation section, this one's DebianNet(3) and it's literally your new bestie for messing with /etc/inetd.conf ✨


🌸 NAME 🌸

DebianNet β€” create, remove, enable or disable an entry in /etc/inetd.conf. that's the whole vibe πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, you can use the functions inside DebianNet to add, remove, enable or disable entries in the /etc/inetd.conf file. and here's the iconic part: after /etc/inetd.conf has been changed, a SIGHUP signal gets sent to the inetd process to make sure that inetd will use the new /etc/inetd.conf file. no manual restart needed, she just knows πŸ’…

the functions can also be used to add entries that are commented out by default. they'll be treated like normal entries. which also means β€” and this is the part you gotta hear β€” 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. periodt. 🫢

also: the DebianNet functions treat entries that are commented out by a single '#' character as entries that have been commented out by a user. it will not change such entries. hands off, that's the user's business πŸ™ˆ

if you're doing shell scripts, you can also just use the update-inetd command instead. see update-inetd(8) for further info, iykyk.


✨ VARIABLES ✨

  • $DebianNet::INETD_CONF β€” holds a scalar filename to use as the inetd config file (e.g. for testing purposes, go off queen). defaults to /etc/inetd.conf.
  • $DebianNet::SEP β€” holds the entry comment characters. this is only necessary if you have to deal with two (or more) services of the same name. defaults to "#<off># " as the comment characters.
  • $DebianNet::MULTI β€” holds 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. defaults to false.
  • $DebianNet::VERBOSE β€” holds a boolean to select whether to explain verbosely what is being done. defaults to false.

πŸ”₯ FUNCTIONS πŸ”₯

  • $rc = DebianNet::add_service($newentry, $group)

add $newentry to the group $group of the /etc/inetd.conf file. if the entry already exists it will be enabled (it will also detect entries with different program options, she's observant like that πŸ‘€). using $group is optional β€” the default group is the group OTHER. if the group does not exist, the entry will be placed at the end of the file.

returns 1 on success, and -1 on failure. this function might call exit() due to debconf prompt answers, so like, heads up 😭

  • $rc = DebianNet::remove_service($entry)

remove $entry from /etc/inetd.conf. you can use a regular expression to remove the entry. slay.

returns 1 on success, and -1 on failure.

  • $rc = DebianNet::disable_service($service, $pattern)

disable $service (e.g. "ftp") in /etc/inetd.conf. using $pattern is optional (see enable_service()).

returns 1 on success, and -1 on failure.

  • $rc = DebianNet::enable_service($service, $pattern)

enable $service (e.g. "ftp") in /etc/inetd.conf. using $pattern 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.

an example: you have three ftp entries in the /etc/inetd.conf file (all disabled by default) and you want to enable the entry which uses the vsftpd daemon. to do this, use the pattern "vsftpd" (or any other regular expression that matches this entry).

returns 1 on success, and -1 on failure.


πŸ’œ CHANGES πŸ’œ

🌈 Version 1.13

  • new variables: $VERSION, $VERBOSE, $MULTI, $SEP, $INETD_CONF. fresh out the box ✨
  • deprecated variables: $version, $verbose, $multi, $sep, $inetdcf. bestie... let them go πŸ’€

ok that's the whole page, no notes, go forth and edit your /etc/inetd.conf responsibly 🫢

and that's a wrap on this perl v5.32.0 era, dated 2020-12-24 β€” DebianNet(3) out πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from