Munin::Node::OS(3pm)

πŸ’– Munin::Node::OS πŸ’–

okay so bestie, welcome to Munin::Node::OS β€” it's the User Contributed Perl Documentation for the OS-related utility methods that the Munin node leans on. it's giving "glue code that does the scary sysadmin stuff so the rest of us can vibe". πŸ¦‹


✨ NAME ✨

Munin::Node::OS β€” OS related utility methods for the Munin node. periodt. πŸ’…


🌸 SYNOPSIS 🌸

use Munin::Node::OS;
my $uid  = Munin::Node::OS->get_uid('foo');
my $host = Munin::Node::OS->get_fq_hostname();

like. that's it. that's the whole entrance. iconic behavior honestly. πŸŽ€


πŸ‘‘ METHODS πŸ‘‘

πŸ’œ get_uid

$uid = $class->get_uid($user)

Returns the user ID. $user might either be a user name or a user ID. Returns undef if the user doesn't exist. no user, no uid, no drama. 😭

πŸ’œ get_gid

$gid = $class->get_gid($group)

Returns the group ID. $group might either be a group name or a group ID. Returns undef if the group doesn't exist. same energy as above but for groups bestie. 🫢

πŸ’œ get_fq_hostname

$host = $class->get_fq_hostname()

Returns the fully qualified host name of the machine. the whole thing. not the nickname. the government name. ✨

πŸ’œ check_perms_if_paranoid

$bool = $class->check_perms_if_paranoid($target);

If paranoia is enabled, returns false unless $target is owned by root, and has safe permissions. If $target is a file, it also checks the directory it inhabits. yes it's checking the file's home too. it's thorough like that. πŸ”₯

πŸ’œ run_as_child

$result = run_as_child($timeout, $coderef, @arguments);

Creates a child process to run $code and waits for up to $timeout seconds for it to complete. Returns a hashref containing the following keys:

  • "stdout", "stderr" β€” array references containing the output of these filehandles;
  • "retval" β€” the result of wait();
  • "timed_out" β€” true if the child had to be interrupted.
⚠️ System errors will cause it to carp. so like, it WILL yell at you. respectfully. 😭

πŸ’œ reap_child_group

$class->reap_child_group($pid);

Sends SIGHUP and SIGKILL to the process group identified by $pid.

It sleeps for 2 seconds between SIGHUP and SIGKILL. a lil pause. a moment of silence. then it's over. πŸ’€

πŸ’œ possible_to_signal_process

my $bool = $class->possible_to_signal_process($pid)

Check whether it's possible to send a signal to $pid (that means, to be brief, that the process is owned by the same user, or we are the super-user). This is a useful way to check that a child process is alive (even if only as a zombie) and hasn't changed its UID. zombie check!! not the fun kind of zombie but ok. 🧟

πŸ’œ set_effective_user_id

eval {
    $class->set_effective_user_id($uid);
};
if ($@) {
    # Failed to set EUID
}

The name says it all ... it literally does. it sets the effective user id. no notes. πŸ’…

πŸ’œ set_effective_group_id

See documentation for set_effective_user_id(). copy-paste queen behavior, we love a consistent API. πŸŽ€

πŸ’œ set_real_user_id

See documentation for set_effective_user_id(). ✨

πŸ’œ set_real_group_id

See documentation for set_effective_user_id(). πŸ’–

πŸ’œ set_umask

Set umask so that files created by plugins are group writable. Only call right before exec-ing a plugin. like, RIGHT before. timing matters bestie. ⚠️


and that's the whole page, no cap. every flag, every method, every undef, all accounted for. 🫢

this lil masterpiece is from perl v5.42.3, dated 2026-09-30, and lives under the name Munin::Node::OS(3pm) β€” so if you cite it, cite it right. mwah. πŸ’‹

πŸ“¦ where this page comes from