Changeset 426
- Timestamp:
- 06/23/12 14:29:07 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/trunk/bin/sophie-notify
- Property svn:executable set to *
r425 r426 36 36 $configfile ||= '/etc/sophie/sophie-notify.conf'; 37 37 38 if (-f $configfile && (my $conf = Config::General->new($configfile))) { 39 my %config = $conf->getall; 40 $server ||= $config{url}; 41 $login ||= $config{login}; 42 $pass ||= $config{pass}; 43 $proxy ||= $config{proxy}; 44 $pidfile ||= $config{pidfile}; 45 $runas ||= $config{runas}; 38 if (-f $configfile) { 39 if (my $conf = Config::General->new($configfile)) { 40 my %config = $conf->getall; 41 $server ||= $config{url}; 42 $login ||= $config{login}; 43 $pass ||= $config{pass}; 44 $proxy ||= $config{proxy}; 45 $pidfile ||= $config{pidfile}; 46 $runas ||= $config{runas}; 47 } else { 48 die "Cannot ope configuration file $configfile\n"; 49 } 46 50 } 47 51 48 52 $updated_inotify ||= 500; 53 54 if ($daemon) { 55 if (fork()) { 56 exit(0); 57 } 58 } 59 60 if ($pidfile) { 61 if (open(my $handle, '>', $pidfile)) { 62 print $handle $$ . "\n"; 63 close($handle); 64 } else { 65 } 66 } 67 49 68 50 69 if ($runas) { … … 56 75 if ($> ne $uid) { 57 76 die "Cannot change to user $runas\n"; 58 }59 }60 61 62 if ($daemon) {63 if (fork()) {64 exit(0);65 77 } 66 78 } … … 76 88 warn "Can't access to sophie web site, waiting 60s before retry\n"; 77 89 sleep 60; 78 }79 80 if ($pidfile) {81 if (open(my $handle, '>', $pidfile)) {82 print $handle $$ . "\n";83 close($handle);84 } else {85 }86 90 } 87 91
Note: See TracChangeset
for help on using the changeset viewer.