Linux-realtimed
view release on metacpan or search on metacpan
bin/realtimed view on Meta::CPAN
my $programname = 'realtimed';
$programname = $1 if $myfullpath =~ m{([^/]+)$};
openlog $programname, 'ndelay,pid', 'daemon';
info "detected current realtimed relative path as: $myrelpath";
info "detected current realtimed absolute path as: $myfullpath";
info "detected program name as: $programname";
my $euid = geteuid;
my $uid = getuid;
my $user = getpwuid($uid);
my $euser = getpwuid($euid);
my $rootuser = getpwuid(0);
unless ($euid == $uid){
my $msg = "you ($user) are executing this program with setuid to $euser credentials, exiting";
emerg $msg;
say $msg;
exit;
}
unless ($uid == 0){
my $msg = "you are executing this program with $user credentials, this program requires $rootuser (uid 0) credentials to work";
( run in 0.229 second using v1.01-cache-2.11-cpan-8d75d55dd25 )