Result:
found more than 693 distributions - search limited to the first 2001 files matching your query ( run in 1.552 )


Daemon-Device

 view release on metacpan or  search on metacpan

lib/Daemon/Device.pm  view on Meta::CPAN


    if ( not $self->{_daemon}{user} ) {
        my $user = getlogin || getpwuid($<) || 'root';
        $self->{_daemon}{user} ||= $user;
    }
    $self->{_daemon}{group} ||= ( getgrgid( (getpwnam( $self->{_daemon}{user} ) )[3] ) )[0];

    croak 'new() called without "daemon" parameter as a hashref' unless ( ref( $self->{_daemon} ) eq 'HASH' );
    for ( qw( program program_args ) ) {
        croak qq{new() called with "daemon" hashref containing "$_" key} if ( $self->{_daemon}{$_} );
    }

 view all matches for this distribution


Daemonise

 view release on metacpan or  search on metacpan

lib/Daemonise/Plugin/Daemon.pm  view on Meta::CPAN

    is      => 'rw',
    default => sub { 'root' },
);


has 'gid' => (is => 'rw');


has 'pid_file' => (
    is        => 'rw',
    predicate => 'has_pid_file',

lib/Daemonise/Plugin/Daemon.pm  view on Meta::CPAN


    $self->phase('starting');
    $self->check_pid_file if $self->has_pid_file;

    $self->uid($self->_get_uid);
    $self->gid($self->_get_gid);
    $self->gid((split /\s+/, $self->gid)[0]);

    # turn off logging to STDOUT when running in background
    $self->print_log(0);

    my $pid = $self->async;

lib/Daemonise/Plugin/Daemon.pm  view on Meta::CPAN

    }
    else {
        $self->_create_pid_file if $self->has_pid_file;

        ### make sure we can remove the file later
        chown($self->uid, $self->gid, $self->pid_file)
            if $self->has_pid_file;

        ### become another user and group
        $self->_set_user;

lib/Daemonise/Plugin/Daemon.pm  view on Meta::CPAN

    die 'No such user "' . $self->user . '"' unless defined $uid;

    return $uid;
}

sub _get_gid {
    my ($self) = @_;

    my @gid = ();
    foreach my $group (split(/[, ]+/, join(" ", $self->group))) {
        if ($group =~ /^\d+$/) {
            push @gid, $group;
        }
        else {
            my $id = getgrnam($group);
            die "No such group \"$group\"" unless defined $id;
            push @gid, $id;
        }
    }

    die "No group found in arguments." unless @gid;

    return join(" ", $gid[0], @gid);
}

sub _create_pid_file {
    my ($self) = @_;

lib/Daemonise/Plugin/Daemon.pm  view on Meta::CPAN

}

sub _set_user {
    my ($self) = @_;

    $self->_set_gid || return;
    $self->_set_uid || return;

    return 1;
}

lib/Daemonise/Plugin/Daemon.pm  view on Meta::CPAN

    }

    return 1;
}

sub _set_gid {
    my ($self) = @_;

    my $gids = $self->_get_gid;
    my $gid = (split /\s+/, $gids)[0];

    # store all the gids - this is really sort of optional
    eval { local $) = $gids };

    POSIX::setgid($gid);

    # look for any valid gid in the list
    if (!grep { $gid == $_ } split /\s+/, $() {
        die "Couldn't become gid \"$gid\": $!\n";
    }

    return 1;
}

lib/Daemonise/Plugin/Daemon.pm  view on Meta::CPAN


=head2 uid

=head2 group

=head2 gid

=head2 pid_file

=head2 running

 view all matches for this distribution


Daje-Plugin-Tools

 view release on metacpan or  search on metacpan

_Deparsed_XSubs.pm  view on Meta::CPAN

sub fsync;
sub ftell;
sub fwrite;
sub getchar;
sub getcwd;
sub getegid;
sub getenv;
sub geteuid;
sub getgid;
sub getgroups;
sub getpid;
sub gets;
sub getuid;
sub isatty;

_Deparsed_XSubs.pm  view on Meta::CPAN

sub realloc;
sub remove;
sub rewind;
sub scanf;
sub setbuf;
sub setgid;
sub setjmp;
sub setlocale;
sub setpgid;
sub setsid;
sub setuid;
sub setvbuf;
sub sigaction;
sub siglongjmp;

_Deparsed_XSubs.pm  view on Meta::CPAN

sub ftell;
sub fwrite;
sub getc;
sub getchar;
sub getcwd;
sub getegid;
sub getenv;
sub geteuid;
sub getgid;
sub getgrgid;
sub getgrnam;
sub getgroups;
sub getlogin;
sub getpayload;
sub getpgrp;

_Deparsed_XSubs.pm  view on Meta::CPAN

sub rmdir;
sub round;
sub scalbn;
sub scanf;
sub setbuf;
sub setgid;
sub setjmp;
sub setlocale;
sub setpayload;
sub setpayloadsig;
sub setpgid;
sub setsid;
sub setuid;
sub setvbuf;
sub sigaction;
sub siglongjmp;

 view all matches for this distribution


( run in 1.552 second using v1.01-cache-2.11-cpan-5735350b133 )