What about add pid file? :)

Mrak
2010-01-20
2013-05-02
  • Mrak

    Mrak - 2010-01-20

    $ diff -c sss.pl sss_new.pl
    *** sss.pl 2010-01-20 02:00:08.000000000 +0300
    -- sss_new.pl 2010-01-20 14:33:33.000000000 +0300
    ***************
    *** 148,153 ****
    -- 148,154 ---
      our $daemon   = 0; #run as a daemon or not (0/1)
      our $logging  = 0; #logging on or off (0/1)
      our $logfile  = './sss.log';
    + our $pid_file = './sss.pid';
     
      ## Language
      my $lang_daemon="Process (%s) has entered into background.\n";
    ***************
    *** 170,175 ****
    -- 171,177 ---
      # Install using: perl -MCPAN -e'install %module'
      use IO::Socket::INET;
      use Digest::MD5 qw(md5_hex);
    + use File::Pid;
     
      #Parse auth part
      if ($auth_login && $auth_login =~ m/:/) {
    ***************
    *** 189,194 ****
    -- 191,201 ---
        }
      }
     
    + if(defined($pid_file) && $pid_file ne ''){
    + my $pidfile = File::Pid->new({ file => $pid_file }); 
    + $pidfile->write;
    + }
    +
      # Start client
      our $client;
      while($client = $bind->accept()) {

     
  • Mrak

    Mrak - 2010-01-20

    I sorry… this code id not working because fork() working :(

    What about change fork() to perl threads?

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks