realmmgr(3)
π realmmgr(3) β Net::DNS::SEC::Tools::realmmgr π
okay so bestie, this is a page from the User Contributed Perl Documentation and honestly? it's a whole vibe. it's giving "let me talk to the realms manager" energy and we're gonna get through it together π
β¨ NAME β¨
Net::DNS::SEC::Tools::realmmgr β the module that lets your program talk to the DNSSEC-Tools dtrealms realms manager. like a little walkie-talkie but for realms π«Ά
β¨ SYNOPSIS β¨
use Net::DNS::SEC::Tools::realmmgr;
$dir = realmmgr_dir();
$idfile = realmmgr_idfile();
$id = realmmgr_getid();
realmmgr_dropid();
realmmgr_rmid();
realmmgr_cmdint();
$runflag = realmmgr_running();
realmmgr_halt();
realmmgr_channel(1);
($cmd,$data) = realmmgr_getcmd();
$ret = realmmgr_verifycmd($cmd);
realmmgr_sendcmd(CHANNEL_CLOSE,REALMCMD_STARTREALM,"example-realm");
realmmgr_sendcmd(CHANNEL_WAIT,REALMCMD_STARTREALM,"example-realm");
($retcode, $respmsg) = realmmgr_getresp();
β¨ DESCRIPTION β¨
so Net::DNS::SEC::Tools::realmmgr hands you standard, platform-independent methods so your program can chat with DNSSEC-Tools' dtrealms realms manager. iconic behavior honestly π₯
there are two interface classes described here, and yes we're covering both:
- general interfaces
- communications interfaces
β¨ GENERAL INTERFACES β¨
these are the interfaces to the Net::DNS::SEC::Tools::realmmgr module, listed right here for you π
realmmgr_dir()β this routine returnsdtrealms's directory. that's it. that's the whole job β¨realmmgr_idfile()β this routine returnsdtrealms's id file. very demure, very mindful.realmmgr_getid()β this routine returnsdtrealms's process id. and listen π β if a non-zero value is passed as an argument, the id file will be left open and accessible through thePIDFILEfile handle. see the WARNINGS section below, no cap.
return values:
On success, the first portion of the file contents
(up to 80 characters) is returned.
-1 is returned if the id file does not exist.
realmmgr_dropid()β this interface makes sure another instance ofdtrealmsis not running, and then creates an id file for future reference. main character energy: claiming the id file before anyone else can π«Ά
return values:
1 - the id file was successfully created for this process
0 - another process is already acting as dtrealms
-1 - unable to create the id file
realmmgr_rmid()β this interface deletesdtrealms's id file. bye bestie π
return values:
1 - the id file was successfully deleted
0 - no id file exists
-1 - the calling process is not dtrealms
-2 - unable to delete the id file
realmmgr_cmdint()β this routine informsdtrealmsthat a command has been sent viarealmmgr_sendcmd(). like a little "psst, incoming π¨"
return values:
-1 - an invalid process id was found for dtrealms
Anything else indicates the number of processes that were
signaled.
(This should only ever be 1.)
realmmgr_running()β this routine figures out ifdtrealmsis running and returns a value telling you the status. vibe check on the process π
return values:
1 - dtrealms is running.
0 - The process listed in the dtrealms process id file
is not running.
-1 - Unable to get the dtrealms process id.
realmmgr_halt()β this routine informsdtrealmsto shut down. it's telling it to go to sleep, respectfully π΄
in the current implementation, the return code from the kill() command is returned.
-1 - an invalid process id was found for dtrealms
Anything else indicates the number of processes that were
signaled.
(This should only ever be 1.)
β¨ DTREALMS COMMUNICATIONS INTERFACES β¨
now for the group-chat part, where everyone actually talks to each other π¬
realmmgr_channel(serverflag)β this interface sets up a persistent channel for communications withdtrealms. if serverflag is true, then the server's side of the channel is created. if serverflag is false, then the client's side of the channel is created.
currently, the connection may only be made to the localhost. this may be changed to allow remote connections, if this is found to be needed. (so for now it's a very local group chat, iykyk πΈ)
return values:
1 - Communications channel successfully established.
0 - Unable to connect to the server.
-1 - Unable to create a Unix socket.
-2 - Unable to bind to the Unix socket. (server only)
-3 - Unable to change the permissions on the Unix socket. (server only)
-4 - Unable to listen on the Unix socket. (server only)
-5 - The socket name was longer than allowed for a Unix socket.
realmmgr_queuecmd(cmdname, value)β this interface internally remembers a command and its optional value for later processing. it's putting a message in drafts until it's ready π₯ seerealmmgr_getcmd()next for further details.realmmgr_getcmd()βrealmmgr_getcmd()processes commands that need to be dealt with. if there are any internally stored commands queued via therealmmgr_queuecmd()function, they are dealt with first. after that, it retrieves a command sent overdtrealms's communications channel by a client program. the command and the command's data are sent in each message.
the command and the command's data are returned to the caller. two-for-one deal, slay π
realmmgr_sendcmd(closeflag,cmd,data)βrealmmgr_sendcmd()sends a command todtrealms. the command must be one of the commands from the table below. this interface creates a communications channel todtrealmsand sends the message. the channel is not closed, in case the caller wants to receive a response fromdtrealms. (leaving the door open in case they text back π«Ά)
the available commands and their required data are:
command data purpose
------- ---- -------
REALMCMD_COMMAND realm, command run command in a realm
REALMCMD_DISPLAY 1/0 start/stop dtrealms'
graphical display
REALMCMD_GETSTATUS none currently unused
REALMCMD_LOGFILE log filename change the log file
REALMCMD_LOGLEVEL log level set a new logging level
REALMCMD_LOGMSG log message add a message to the log
REALMCMD_LOGTZ timezone set timezone for log messages
REALMCMD_NODISPLAY 0 stop dtrealms' graphical display
REALMCMD_REALMSTATUS none get status of the realms
REALMCMD_SHUTDOWN none stop dtrealms and its realms
REALMCMD_STARTALL none start all stopped realms
REALMCMD_STOPALL none stop all running realms
REALMCMD_STARTREALM realm name restart a suspended realm
REALMCMD_STOPREALM realm name stop realm
REALMCMD_STATUS none get status of dtrealms
the data aren't checked for validity by realmmgr_sendcmd(); validity checking is a responsibility of dtrealms. not our job, bestie π
if the caller does not need a response from dtrealms, then closeflag should be set to CHANNEL_CLOSE; if a response is required then closeflag should be CHANNEL_WAIT. these values are boolean values, and the constants aren't required.
on success, 1 is returned. if an invalid command is given, 0 is returned.
realmmgr_getresp()β after executing a client command sent viarealmmgr_sendcmd(),dtrealmswill send a response to the client.realmmgr_getresp()allows the client to retrieve the response. it's the reply notification π
a return code and a response string are returned, in that order. both are specific to the command sent.
realmmgr_verifycmd(cmd)βrealmmgr_verifycmd()verifies that cmd is a valid command fordtrealms.1is returned for a valid command;0is returned for an invalid command.
1 is returned for a valid command; 0 is returned for an invalid command.
(yes it says it twice. the original says it twice too. we don't question the icon, we just respect it π)
β¨ WARNINGS β¨
these are the real ones. pay attention fr fr π
realmmgr_getid()attempts to exclusively lock the id file. set a timer if this matters to you. β°realmmgr_getid()has a nice little race condition. we should lock the file prior to opening it, but we can't do so without it being open. it's giving chaos and we're just living with it π
β¨ COPYRIGHT β¨
Copyright 2012-2014 SPARTA, Inc. All rights reserved. see the COPYING file included with the DNSSEC-Tools package for details. protect the intellectual property bestie π
β¨ AUTHOR β¨
Wayne Morrison, tewok@tislabs.com β shoutout to the actual author of this page, icon behavior π
β¨ SEE ALSO β¨
realmctl(1)dtrealms(8)Net::DNS::SEC::Tools::realm.pm(3),Net::DNS::SEC::Tools::rolllog.pm(3),Net::DNS::SEC::Tools::rollmgr.pm(3)
okay that's the whole page and you ate it up π this was perl v5.44.0, dated 2026-10-17, and the page is realmmgr(3) β go forth and manage those realms, bestie πβ
π¦ where this page comes from
- arch rolling: dnssec-tools 2.2.3-16 Β· BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms