[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] debianqueued



tell on which hostname it runs on

Signed-off-by: Joerg Jaspert <joerg@debian.org>
---
 tools/debianqueued-0.9/debianqueued |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/tools/debianqueued-0.9/debianqueued b/tools/debianqueued-0.9/debianqueued
index 256561a..f997436 100755
--- a/tools/debianqueued-0.9/debianqueued
+++ b/tools/debianqueued-0.9/debianqueued
@@ -21,6 +21,7 @@ use Net::Ping;
 use Net::FTP;
 use Socket qw( PF_INET AF_INET SOCK_STREAM );
 use Config;
+use Sys::Hostname;
 
 # ---------------------------------------------------------------------------
 #								configuration
@@ -61,6 +62,8 @@ package main;
 
 ( $main::progname = $0 ) =~ s,.*/,,;
 
+($main::hostname, undef, undef, undef, undef) = gethostbyname(hostname());
+
 my %packages = ();
 
 # extract -r and -k args
@@ -135,7 +138,7 @@ if ( !@ARGV ) {
     POSIX::sigsuspend($sigset);
     waitpid( $pid, WNOHANG );
     if ( kill( 0, $pid ) ) {
-      print "Daemon started in background (pid $pid)\n";
+      print "Daemon (on $main::hostname) started in background (pid $pid)\n";
       exit 0;
     } else {
       exit 1;
@@ -165,9 +168,7 @@ my $parent_pid = $ARGV[1];
 
 do {
   my $version;
-  ( $version =
-'Release: 0.9 $Revision: 1.51 $ $Date: 1999/07/08 09:43:21 $ $Author: ftplinux $'
-  ) =~ s/\$ ?//g;
+  ( $version = 'Release: 0.95' ) =~ s/\$ ?//g;
   print "debianqueued $version\n";
 };
 
@@ -329,7 +330,7 @@ open( STDERR, ">&LOG" )
   or die "$main::progname: Can't redirect stderr to $conf::logfile: $!\n";
 
 # ok, from this point usually no "die" anymore, stderr is gone!
-msg( "log", "daemon (pid $$) started\n" );
+msg( "log", "daemon (pid $$) (on $main::hostname) started\n" );
 
 # initialize variables used by send_status before launching the status daemon
 $main::dstat = "i";
@@ -2339,7 +2340,7 @@ __MESSAGE__
   }
 
   $message .= "\n$text";
-  $message .= "\nGreetings,\n\n\tYour Debian queue daemon\n";
+  $message .= "\nGreetings,\n\n\tYour Debian queue daemon (running on host $main::hostname)\n";
 
   my $mail = Email::Send->new;
   for (qw[Sendmail SMTP]) {
-- 
1.5.6.5


Reply to: