main.pm 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. package eyelib::main;
  2. #
  3. # Copyright (C) Roman Dmitiriev, rnd@rajven.ru
  4. #
  5. use utf8;
  6. use strict;
  7. use English;
  8. use FindBin '$Bin';
  9. use lib "$Bin";
  10. use base 'Exporter';
  11. use vars qw(@EXPORT @ISA);
  12. use eyelib::config;
  13. use Socket;
  14. use IO::Select;
  15. use IO::Handle;
  16. use Crypt::CBC;
  17. use MIME::Base64;
  18. our @ISA = qw(Exporter);
  19. our @EXPORT = qw(
  20. eye_version
  21. log_file
  22. write_to_file
  23. wrlog
  24. log_session
  25. log_warning
  26. log_info
  27. log_debug
  28. log_error
  29. log_verbose
  30. log_die
  31. timestamp
  32. do_exec
  33. do_exec_ref
  34. do_exit
  35. sendEmail
  36. IsNotRun
  37. IsMyPID
  38. Add_PID
  39. Remove_PID
  40. IsNotLocked
  41. IsMyLock
  42. Add_Lock
  43. Remove_Lock
  44. DefHash
  45. read_file
  46. uniq
  47. strim
  48. trim
  49. is_integer
  50. is_float
  51. run_in_parallel
  52. translit
  53. crypt_string
  54. decrypt_string
  55. netdev_set_auth
  56. );
  57. BEGIN
  58. {
  59. our $eye_version = "2.4.13";
  60. #---------------------------------------------------------------------------------------------------------
  61. sub log_file {
  62. return if (!$_[0]);
  63. return if (!$_[1]);
  64. return if (!$_[2]);
  65. open (LG,">>$_[0]") || die("Error open log file $_[0]!!! die...");
  66. my ($sec,$min,$hour,$mday,$mon,$year) = (localtime())[0,1,2,3,4,5];
  67. $mon += 1; $year += 1900;
  68. my @msg = split("\n",$_[2]);
  69. foreach my $row (@msg) {
  70. next if (!$row);
  71. printf LG "%04d%02d%02d-%02d%02d%02d %s [%d] %s\n",$year,$mon,$mday,$hour,$min,$sec,$_[1],$$,$row;
  72. }
  73. close (LG);
  74. if ($< ==0) {
  75. my $uid = getpwnam $log_owner_user;
  76. my $gid = getgrnam $log_owner_user;
  77. if (!$gid) { $gid=getgrnam "root"; }
  78. if (!$uid) { $uid=getpwnam "root"; }
  79. chown $uid, $gid, $_[0];
  80. chmod oct("0660"), $_[0];
  81. }
  82. }
  83. #---------------------------------------------------------------------------------------------------------
  84. sub write_to_file {
  85. return if (!$_[0]);
  86. return if (!$_[1]);
  87. my $f_name = shift;
  88. my $cmd = shift;
  89. my $append = shift;
  90. if ($append) {
  91. open (LG,">>$f_name") || die("Error open file $f_name!!! die...");
  92. } else {
  93. open (LG,">$f_name") || die("Error open file $f_name!!! die...");
  94. }
  95. binmode(LG,':utf8');
  96. if (ref($cmd) eq 'ARRAY') {
  97. foreach my $row (@$cmd) {
  98. next if (!$row);
  99. print LG $row."\n";
  100. }
  101. } else {
  102. my @msg = split("\n",$cmd);
  103. foreach my $row (@msg) {
  104. next if (!$row);
  105. print LG $row."\n";
  106. }
  107. }
  108. close (LG);
  109. }
  110. #---------------------------------------------------------------------------------------------------------
  111. sub wrlog {
  112. my $level = shift;
  113. my $string = shift;
  114. my $PRN_LEVEL = 'INFO:';
  115. if ($level == $W_INFO) { log_info($string); }
  116. if ($level == $W_ERROR) { $PRN_LEVEL = 'ERROR:'; log_error($string); }
  117. if ($level == $W_DEBUG) { $PRN_LEVEL = 'DEBUG'; log_debug($string); }
  118. my @msg = split("\n",$string);
  119. foreach my $row (@msg) {
  120. next if (!$row);
  121. print $PRN_LEVEL.' '.$row."\n";
  122. }
  123. }
  124. #---------------------------------------------------------------------------------------------------------
  125. sub log_session { log_file($LOG_COMMON,"SESSION:",$_[0]) if ($log_enable); }
  126. #---------------------------------------------------------------------------------------------------------
  127. sub log_info { log_file($LOG_COMMON,"INFO:",$_[0]) if ($log_enable); }
  128. #---------------------------------------------------------------------------------------------------------
  129. sub log_verbose { log_file($LOG_COMMON,"VERBOSE:",$_[0]) if ($log_enable); }
  130. #---------------------------------------------------------------------------------------------------------
  131. sub log_warning { log_file($LOG_COMMON,"WARN:",$_[0]) if ($log_enable); }
  132. #---------------------------------------------------------------------------------------------------------
  133. sub log_debug { log_file($LOG_DEBUG,"DEBUG:",$_[0]) if $debug; }
  134. #---------------------------------------------------------------------------------------------------------
  135. sub log_error { log_file($LOG_ERR,"ERROR:",$_[0]) if ($log_enable); }
  136. #---------------------------------------------------------------------------------------------------------
  137. sub log_die {
  138. wrlog($W_ERROR,$_[0]);
  139. my $worktime = time()-$BASETIME;
  140. log_info("Script work $worktime sec.");
  141. sendEmail("$HOSTNAME - $MY_NAME die! ","Process: $MY_NAME aborted with error:\n$_[0]");
  142. die ($_[0]);
  143. }
  144. #---------------------------------------------------------------------------------------------------------
  145. sub timestamp {
  146. my $worktime = time()-$BASETIME;
  147. log_info("TimeStamp: $worktime sec.");
  148. }
  149. #---------------------------------------------------------------------------------------------------------.
  150. sub do_exec_ref {
  151. my $ret = `$_[0]`;
  152. my $res = $?;
  153. my %result;
  154. chomp($ret);
  155. $result{output}=$ret;
  156. $result{status}=$res;
  157. log_debug("Run: $_[0] Output:\n$ret\nResult code: $res");
  158. if ($res eq "0") { log_info("Run: $_[0] - $ret"); } else { log_error("Run: $_[0] - $ret"); }
  159. return %result;
  160. }
  161. #---------------------------------------------------------------------------------------------------------
  162. sub do_exec {
  163. my $ret = `$_[0]`;
  164. my $res = $?;
  165. log_debug("Run: $_[0] Output:\n$ret\nResult code: $res");
  166. if ($res eq "0") {
  167. log_info("Run: $_[0] - $ret");
  168. } else {
  169. $ret = "Error";
  170. log_error("Run: $_[0] - $ret");
  171. }
  172. return $ret;
  173. }
  174. #---------------------------------------------------------------------------------------------------------
  175. sub do_exit {
  176. my $worktime = time()-$BASETIME;
  177. my $code;
  178. if ($_[0]) { $code = $_[0]; } else { $code = 0; }
  179. log_info("Script work $worktime sec. Exit code: $code");
  180. exit $code;
  181. }
  182. #---------------------------------------------------------------------------------------------------------
  183. sub sendEmail {
  184. my ($subject, $message, $crf) = @_;
  185. return if (!$send_email);
  186. my $sendmail = '/sbin/sendmail';
  187. open(MAIL, "|$sendmail -oi -t");
  188. print MAIL "From: $sender_email\n";
  189. print MAIL "To: $admin_email\n";
  190. print MAIL "Subject: $subject\nMIME-Version: 1.0\nContent-Language: ru\nContent-Type: text/html; charset=utf-8\nContent-Transfer-Encoding: 8bit\n\n";
  191. print MAIL '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n";
  192. print MAIL '<html xmlns="http://www.w3.org/1999/xhtml">'."\n";
  193. print MAIL "<head><title>$subject </title></head><body>\n";
  194. my @msg = split("\n",$message);
  195. foreach my $row (@msg) {
  196. if ($crf) { print MAIL "$row<br>"; } else { print MAIL "$row\n"; };
  197. }
  198. print MAIL "</body></html>\n";
  199. close(MAIL);
  200. log_info("Send email from $sender_email to $admin_email with subject: $subject");
  201. log_debug("Body:\n$message");
  202. }
  203. #---------------------------------------------------------------------------------------------------------
  204. ### Check few run script
  205. sub IsNotRun {
  206. my $pname = shift;
  207. my $lockfile = $pname.".pid";
  208. # if pid file not exists - OK
  209. log_debug("Check what pid file $lockfile exists.");
  210. if (! -e $lockfile) { log_debug("pid file not found. Continue."); return 1; }
  211. open (FF,"<$lockfile") or log_die("can't open file $lockfile: $!");
  212. my $lockid = <FF>;
  213. close(FF);
  214. chomp($lockid);
  215. # If the process ID belongs to the current program - OK
  216. if ($lockid eq $$) { log_debug("pid file found, but owner is this process. Continue. "); return 1; }
  217. # if owner of this process ID not exists - OK
  218. my $process_count = `ps -p $lockid | grep \'$lockid\' | wc -l`;
  219. chomp($process_count);
  220. log_debug("Process count with id $lockid is $process_count");
  221. if ($process_count==0) { log_debug("pid file found, but owner process not found. Remove lock file and continue. "); unlink $lockfile; return 1; }
  222. log_debug("Another proceess with name $MY_NAME pid: $lockid already worked. ");
  223. return 0;
  224. }
  225. #---------------------------------------------------------------------------------------------------------
  226. sub IsMyPID {
  227. my $pname = shift;
  228. my $lockfile = $pname.".pid";
  229. log_debug("Check what pid file $lockfile exists.");
  230. if (! -e $lockfile) { log_debug("pid file not found. Continue."); return 1; }
  231. open (FF,"<$lockfile") or log_die "can't open file $lockfile: $!";
  232. my $lockid = <FF>;
  233. close(FF);
  234. chomp($lockid);
  235. if ($lockid eq $$) { log_debug("pid file is my. continue."); return 1; }
  236. log_debug("Another proceess with name $MY_NAME pid: $lockid already worked. ");
  237. return 0;
  238. }
  239. #---------------------------------------------------------------------------------------------------------
  240. sub Add_PID {
  241. my $pname = shift;
  242. my $lockfile = $pname.".pid";
  243. log_debug("Try create lock file $lockfile");
  244. open (FF,">$lockfile") or log_die "can't open file $lockfile: $!";
  245. flock(FF,2) or log_die "can't flock $lockfile: $!";
  246. print FF $$;
  247. close(FF);
  248. log_debug("Ok.");
  249. return 1;
  250. }
  251. #---------------------------------------------------------------------------------------------------------
  252. sub Remove_PID {
  253. my $pname = shift;
  254. my $lockfile = $pname.".pid";
  255. log_debug("Check what pid file $lockfile exists.");
  256. if (! -e $lockfile) { log_debug("pid file not exists. Continue."); return 1; }
  257. unlink $lockfile or return 0;
  258. log_debug("pid file $lockfile removed.");
  259. return 1;
  260. }
  261. #---------------------------------------------------------------------------------------------------------
  262. sub IsNotLocked {
  263. my $lockfile = $_[0] . ".lock";
  264. log_debug("Check what lock file $lockfile exists.");
  265. if (! -e $lockfile) { log_debug("lock file not found. Continue."); return 1; }
  266. open (FF,"<$lockfile") or log_die "can't open file $lockfile: $!";
  267. my $lockid = <FF>;
  268. close(FF);
  269. chomp($lockid);
  270. if ($lockid eq $$) { log_debug("lock file found, but it is owner is this process. Continue. "); return 1; }
  271. my $process_count = `ps -p $lockid | grep \'$lockid\' | wc -l`;
  272. if ($process_count lt 1) { log_debug("lock file found, but owner process not found. Remove lock file and continue. "); unlink $lockfile; return 1; }
  273. log_debug("Another proceess with pid: $lockid already use $_[0]");
  274. return 0;
  275. }
  276. #---------------------------------------------------------------------------------------------------------
  277. sub IsMyLock {
  278. my $lockfile = $_[0] . ".lock";
  279. log_debug("Check what lock file $lockfile exists.");
  280. if (! -e $lockfile) { log_debug("lock file not found. Continue."); return 0; }
  281. open (FF,"<$lockfile") or log_die "can't open file $lockfile: $!";
  282. my $lockid = <FF>;
  283. close(FF);
  284. chomp($lockid);
  285. if ($lockid eq $$) { log_debug("lock file found, but it is owner is this process. Continue. "); return 1; }
  286. log_debug("file $_[0] used by process with pid: $lockid");
  287. return 0;
  288. }
  289. #---------------------------------------------------------------------------------------------------------
  290. sub Add_Lock {
  291. if (!IsNotLocked($_[0])) { return 0; }
  292. my $lockfile = $_[0] . ".lock";
  293. open (FF,">$lockfile") or log_die "can't open file $lockfile: $!";
  294. flock(FF,2) or log_die "can't flock $lockfile: $!";
  295. print FF $$;
  296. close(FF);
  297. log_debug("Create lock file for $_[0]");
  298. return 1;
  299. }
  300. #---------------------------------------------------------------------------------------------------------
  301. sub Remove_Lock {
  302. if (!IsNotLocked($_[0])) { return 0; }
  303. my $lockfile = $_[0] . ".lock";
  304. if (! -e $lockfile) { return 1; }
  305. unlink $lockfile or return 0;
  306. log_debug("Lock file for $_[0] removed");
  307. return 1;
  308. }
  309. #---------------------------------------------------------------------------------------------------------
  310. sub DefHash {
  311. my $hash=$_[0];
  312. my $num_list = $_[1];
  313. my %num_keys;
  314. if ($num_list) {
  315. my @ret_num = split(' ',$num_list);
  316. %num_keys = map { $_, 1 } @ret_num;
  317. }
  318. foreach my $key (keys %$hash) {
  319. my $null_value = "";
  320. $null_value = 0 if (defined $num_keys{$key});
  321. $hash->{$key}=$null_value if (!defined($hash->{$key}));
  322. }
  323. return $hash;
  324. }
  325. #---------------------------------------------------------------------------------------------------------
  326. sub read_file {
  327. my $filename = shift;
  328. return if (!$filename);
  329. return if (!-e $filename);
  330. open (FF,"<$filename") or die "unable to open file $filename!" ;
  331. my @tmp=<FF>;
  332. close(FF);
  333. chomp(@tmp);
  334. return @tmp;
  335. }
  336. #---------------------------------------------------------------------------------------------------------
  337. sub uniq (\@) {
  338. my @tmp = @{(shift)};
  339. if (scalar(@tmp) eq 0) { return @tmp; }
  340. chomp(@tmp);
  341. my %newlist = map { $_, 1 } @tmp;
  342. return keys %newlist;
  343. }
  344. #---------------------------------------------------------------------------------------------------------
  345. sub strim {
  346. my $str=shift;
  347. return if (!$str);
  348. #$str =~ s/.*[^[:print:]]+//g;
  349. #$str =~ s/[^[:print:]]+//g;
  350. #$str =~ s/[^(a-z|A-Z|0-9|\:|\-|\s|\.)]//g;
  351. #$str =~ s/[:^print:]//g;
  352. $str =~ s/[^[:ascii:]]//g;
  353. $str =~ s/^\s+//g;
  354. $str =~ s/\s+$//g;
  355. return $str;
  356. }
  357. #---------------------------------------------------------------------------------------------------------
  358. sub trim {
  359. my $str=shift;
  360. return if (!$str);
  361. $str =~ s/\n/ /g;
  362. $str =~ s/^\s+//g;
  363. $str =~ s/\s+$//g;
  364. return $str;
  365. }
  366. #---------------------------------------------------------------------------------------------------------
  367. sub is_integer {
  368. defined $_[0] && $_[0] =~ /^[+-]?\d+$/;
  369. }
  370. #---------------------------------------------------------------------------------------------------------
  371. sub is_float {
  372. defined $_[0] && $_[0] =~ /^[+-]?\d+(\.\d+)?$/;
  373. }
  374. #---------------------------------------------------------------------------------------------------------
  375. sub run_in_parallel(\@) {
  376. my @commands = @{(shift)};
  377. my @result = ();
  378. return @result if (!@commands or !scalar(@commands));
  379. my $count = scalar(@commands);
  380. my $start = 0;
  381. while ($start<=$count-1) {
  382. my @run_list=();
  383. my $select = IO::Select->new();
  384. my $stop = $start + $parallel_process_count;
  385. $stop=$count-1 if ($stop >=$count);
  386. for (my $index = $start; $index <=$stop; $index++) {
  387. next if (!$commands[$index]);
  388. my $cmd=$commands[$index];
  389. log_info("Starting ".$cmd);
  390. my ($hchild, $hparent, $childid);
  391. socketpair($hchild, $hparent, AF_UNIX, SOCK_STREAM, PF_UNSPEC) or die "socketpair: $!";
  392. $childid = fork;
  393. die "cannot fork" if($childid == -1);
  394. # redirect child Input|Output
  395. unless($childid) {
  396. open STDIN, "<&", $hparent;
  397. open STDOUT, ">&", $hparent;
  398. open STDERR, ">&", $hparent;
  399. close $hparent;
  400. close $hchild;
  401. $select->remove($_) and close $_ for($select->handles);
  402. exec "/bin/nice -n 15 ".$cmd;
  403. }
  404. close $hparent;
  405. $select->add($hchild);
  406. }
  407. while (my @ready = $select->can_read) {
  408. next if (!@ready or !scalar(@ready));
  409. for my $read(@ready) {
  410. if($read->eof || $read->error) {
  411. # child exit
  412. $select->remove($read);
  413. close $read;
  414. next;
  415. }
  416. if(defined(my $str = <$read>)) {
  417. log_info("Read:".$str);
  418. push(@result,$str);
  419. }
  420. }
  421. }
  422. $start = $stop+1;
  423. }
  424. return (@result);
  425. }
  426. #---------------------------------------------------------------------------------
  427. sub translit {
  428. my $textline=shift;
  429. return if (!$textline);
  430. $textline =~ s/А/A/g; $textline =~ s/а/a/g;
  431. $textline =~ s/Б/B/g; $textline =~ s/б/b/g;
  432. $textline =~ s/В/V/g; $textline =~ s/в/v/g;
  433. $textline =~ s/Г/G/g; $textline =~ s/г/g/g;
  434. $textline =~ s/Д/D/g; $textline =~ s/д/d/g;
  435. $textline =~ s/Е/E/g; $textline =~ s/е/e/g;
  436. $textline =~ s/Ё/E/g; $textline =~ s/ё/e/g;
  437. $textline =~ s/Ж/Zh/g; $textline =~ s/ж/zh/g;
  438. $textline =~ s/З/Z/g; $textline =~ s/з/z/g;
  439. $textline =~ s/И/I/g; $textline =~ s/и/i/g;
  440. $textline =~ s/Й/I/g; $textline =~ s/й/i/g;
  441. $textline =~ s/К/K/g; $textline =~ s/к/k/g;
  442. $textline =~ s/Л/L/g; $textline =~ s/л/l/g;
  443. $textline =~ s/М/M/g; $textline =~ s/м/m/g;
  444. $textline =~ s/Н/N/g; $textline =~ s/н/n/g;
  445. $textline =~ s/О/O/g; $textline =~ s/о/o/g;
  446. $textline =~ s/П/P/g; $textline =~ s/п/p/g;
  447. $textline =~ s/Р/R/g; $textline =~ s/р/r/g;
  448. $textline =~ s/ТС/T-S/g; $textline =~ s/Тс/T-s/g; $textline =~ s/тс/t-s/g;
  449. $textline =~ s/С/S/g; $textline =~ s/с/s/g;
  450. $textline =~ s/Т/T/g; $textline =~ s/т/t/g;
  451. $textline =~ s/У/U/g; $textline =~ s/у/u/g;
  452. $textline =~ s/Ф/F/g; $textline =~ s/ф/f/g;
  453. $textline =~ s/Х/Kh/g; $textline =~ s/х/kh/g;
  454. $textline =~ s/Ц/Ts/g; $textline =~ s/ц/ts/g;
  455. $textline =~ s/Ч/Ch/g; $textline =~ s/ч/ch/g;
  456. $textline =~ s/Ш/Sh/g; $textline =~ s/ш/sh/g;
  457. $textline =~ s/Щ/Shch/g; $textline =~ s/щ/shch/g;
  458. #$textline =~ s/Ь/'/g; $textline =~ s/ь/'/g;
  459. #$textline =~ s/Ъ/''/g; $textline =~ s/ъ/''/g;
  460. $textline =~ s/Ь//g; $textline =~ s/ь//g;
  461. $textline =~ s/Ъ//g; $textline =~ s/ъ//g;
  462. $textline =~ s/Ы/Y/g; $textline =~ s/ы/y/g;
  463. $textline =~ s/Э/E/g; $textline =~ s/э/e/g;
  464. $textline =~ s/Ю/Yu/g; $textline =~ s/ю/yu/g;
  465. $textline =~ s/Я/Ya/g; $textline =~ s/я/ya/g;
  466. return $textline;
  467. }
  468. #---------------------------------------------------------------------------------
  469. sub netdev_set_auth {
  470. my $device = shift;
  471. $device->{login}=$config_ref{router_login} if (!$device->{login});
  472. $device->{password}=$config_ref{router_password} if (!$device->{password});
  473. $device->{password}=decrypt_string($device->{password});
  474. $device->{enable_password}='';
  475. #$device->{enable_password}=$device->{passowrd};
  476. $device->{proto} = 'ssh' if ($device->{protocol} eq '0');
  477. $device->{proto} = 'telnet' if ($device->{protocol} eq '1');
  478. $device->{port} = $device->{control_port} if ($device->{control_port});
  479. return $device;
  480. }
  481. #---------------------------------------------------------------------------------
  482. sub decrypt_string {
  483. my $crypted_string = shift;
  484. return if (!$crypted_string);
  485. my $cipher_handle = Crypt::CBC->new(
  486. {
  487. 'key' => $config_ref{encryption_key},
  488. 'cipher' => 'Cipher::AES',
  489. 'iv' => $config_ref{encryption_iv},
  490. 'literal_key' => 1,
  491. 'header' => 'none',
  492. keysize => 128 / 8
  493. }
  494. );
  495. my $result = $cipher_handle->decrypt(decode_base64($crypted_string));
  496. return $result;
  497. }
  498. #---------------------------------------------------------------------------------
  499. sub crypt_string {
  500. my $simple_string = shift;
  501. return if (!$simple_string);
  502. my $cipher_handle = Crypt::CBC->new(
  503. {
  504. 'key' => $config_ref{encryption_key},
  505. 'cipher' => 'Cipher::AES',
  506. 'iv' => $config_ref{encryption_iv},
  507. 'literal_key' => 1,
  508. 'header' => 'none',
  509. keysize => 128 / 8
  510. }
  511. );
  512. my $result = encode_base64($cipher_handle->encrypt($simple_string));
  513. return $result;
  514. }
  515. #---------------------------------------------------------------------------------
  516. #log_file($LOG_COMMON,"INFO:","----------------------------------------------------------------------------------------");
  517. #log_file($LOG_COMMON,"INFO:","Run script $0. Pid: $$ Pid file: $SPID.pid");
  518. #log_file($LOG_COMMON,"INFO:","User uid: $< Effective uid: $>");
  519. #log_file($LOG_COMMON,"INFO:","Status:");
  520. #log_file($LOG_COMMON,"INFO:","Logging enabled: $log_enable");
  521. #log_file($LOG_COMMON,"INFO:","Logging debug: $debug");
  522. 1;
  523. }