From blair at orcaware.com Wed Feb 1 21:21:22 2006 From: blair at orcaware.com (blair at orcaware.com) Date: Wed, 1 Feb 2006 21:21:22 -0800 Subject: [Orca-checkins] r524 - orca/trunk/data_gatherers/procallator Message-ID: <200602020521.k125LM5O009130@orca3.orcaware.com> Author: blair at orcaware.com Date: Wed Feb 1 21:20:54 2006 New Revision: 524 Modified: orca/trunk/data_gatherers/procallator/procallator.pl.in Log: Have procallator do a better job of daemonizing itself. Hopefully, this will enable an 'ssh hostname procallator' to start and close the ssh connection immediately. * data_gatherers/procallator/procallator.pl.in: If $DEBUG is not true, then chdir() into / and re-open() STDIN on /dev/null. Modified: orca/trunk/data_gatherers/procallator/procallator.pl.in ============================================================================== --- orca/trunk/data_gatherers/procallator/procallator.pl.in (original) +++ orca/trunk/data_gatherers/procallator/procallator.pl.in Wed Feb 1 21:20:54 2006 @@ -138,11 +138,20 @@ my (@nfs_s_p3_fsinfo, @nfs_s_p3_pathconf); my (@nfs_s_p3_commit, @nfs_s_p4_compound); +# If procallator should daemonize itself, then do so now. if ( !$DEBUG ) { - use POSIX qw(setsid); - umask 0; - exit(0) if (fork); - setsid; + my $expr = 'use POSIX qw(setsid)'; + local $SIG{__DIE__} = 'DEFAULT'; + local $SIG{__WARN__} = \&die_when_called; + eval $expr; + if ($@) { + die "$0: cannot get POSIX::setsid since eval '$expr' failed: $@\n"; + } + chdir('/') or die "$0: cannot chdir '/': $!\n"; + open(STDIN, '/dev/null') or die "$0: cannot open '/dev/null': $!\n"; + defined(my $pid = fork) or die "$0: cannot fork: $!\n"; + exit(0) if $pid; + POSIX::setsid() or die "$0: cannot start a new session: $!\n"; } # Create output dir if needed From blair at orcaware.com Wed Feb 1 21:26:07 2006 From: blair at orcaware.com (blair at orcaware.com) Date: Wed, 1 Feb 2006 21:26:07 -0800 Subject: [Orca-checkins] r525 - orca/trunk/orca Message-ID: <200602020526.k125Q7hJ009471@orca3.orcaware.com> Author: blair at orcaware.com Date: Wed Feb 1 21:25:42 2006 New Revision: 525 Modified: orca/trunk/orca/orca.pl.in Log: Fix a comment and style issue in Orca on the daemonizing code. * orca/orca.pl.in (main): Remove a comment that POSIX::setsid() is not needed to daemonize Orca and that Orca doesn't need to quit. Orca has always quit if POSIX::setsid() isn't found. Add 0 as an argument to exit(). Modified: orca/trunk/orca/orca.pl.in ============================================================================== --- orca/trunk/orca/orca.pl.in (original) +++ orca/trunk/orca/orca.pl.in Wed Feb 1 21:25:42 2006 @@ -202,9 +202,7 @@ die "$0: cannot open '$opt_log_filename' for writing: $!\n"; } -# If Orca should daemonize itself, then do so now. Find POSIX::setsid -# but do not always use it unless it is needed since some systems do -# not supply POSIX::setsid and Orca should not quit on those systems. +# If Orca should daemonize itself, then do so now. if ($opt_daemon) { my $expr = 'use POSIX qw(setsid)'; local $SIG{__DIE__} = 'DEFAULT'; @@ -214,9 +212,9 @@ die "$0: cannot get setsid since eval '$expr' failed: $@\n"; } chdir('/') or die "$0: cannot chdir '/': $!\n"; - open(STDIN, '/dev/null') or die "$0: cannot read '/dev/null': $!\n"; + open(STDIN, '/dev/null') or die "$0: cannot open '/dev/null': $!\n"; defined(my $pid = fork) or die "$0: cannot fork: $!\n"; - exit if $pid; + exit(0) if $pid; POSIX::setsid() or die "$0: cannot start a new session: $!\n"; } From blair at orcaware.com Thu Feb 23 22:54:11 2006 From: blair at orcaware.com (blair at orcaware.com) Date: Thu, 23 Feb 2006 22:54:11 -0800 Subject: [Orca-checkins] r526 - orca/trunk/lib Message-ID: <200602240654.k1O6sBtZ015352@orca3.orcaware.com> Author: blair at orcaware.com Date: Thu Feb 23 22:53:44 2006 New Revision: 526 Modified: orca/trunk/lib/Makefile.in Log: Split lib's Makefile install target into two targets, install-orca and install-se. This allows the SE addon files to be installed without installing Orca's Perl files. * lib/Makefile.in (install): Depend upon install-orca and install-se. (install-orca): Take the actions from the old install target that install Orca's Perl files into this target. (install-se): Take the actions from the old install target that install the SE addon files. Modified: orca/trunk/lib/Makefile.in ============================================================================== --- orca/trunk/lib/Makefile.in (original) +++ orca/trunk/lib/Makefile.in Thu Feb 23 22:53:44 2006 @@ -31,12 +31,10 @@ test: check -install: all +install: install-orca install-se + +install-orca: all $(MKDIR) $(DESTDIR)$(libdir)/perl/Orca - $(MKDIR) $(DESTDIR)$(libdir)/SE/3.2.1 - $(MKDIR) $(DESTDIR)$(libdir)/SE/3.3 - $(MKDIR) $(DESTDIR)$(libdir)/SE/3.3.1 - $(MKDIR) $(DESTDIR)$(libdir)/SE/3.4 @for f in Orca/*.pm; do \ echo $(INSTALL) -m 0644 $$f $(DESTDIR)$(libdir)/perl/Orca; \ $(INSTALL) -m 0644 $$f $(DESTDIR)$(libdir)/perl/Orca || exit 1; \ @@ -49,14 +47,6 @@ $(INSTALL) -m 0644 $$f $(DESTDIR)$(libdir)/perl/Orca/Config || exit 1; \ done; \ fi - @for d in SE/*; do \ - test ! -d $$d && continue; \ - for f in $$d/*; do \ - test ! -f $$f && continue; \ - echo $(INSTALL) -m 0644 $$f $(DESTDIR)$(libdir)/$$d; \ - $(INSTALL) -m 0644 $$f $(DESTDIR)$(libdir)/$$d || exit 1; \ - done \ - done @echo "cd ..; sh -c 'svnversion .'" @current_rev="`cd ..; sh -c 'svnversion .' 2>/dev/null || true`"; \ echo "Subversion reversion of Orca is: $$current_rev"; \ @@ -73,6 +63,20 @@ echo Not fixing svn revision number in $(DESTDIR)$(libdir)/perl/Orca/Constants.pm; \ fi +install-se: all + $(MKDIR) $(DESTDIR)$(libdir)/SE/3.2.1 + $(MKDIR) $(DESTDIR)$(libdir)/SE/3.3 + $(MKDIR) $(DESTDIR)$(libdir)/SE/3.3.1 + $(MKDIR) $(DESTDIR)$(libdir)/SE/3.4 + @for d in SE/*; do \ + test ! -d $$d && continue; \ + for f in $$d/*; do \ + test ! -f $$f && continue; \ + echo $(INSTALL) -m 0644 $$f $(DESTDIR)$(libdir)/$$d; \ + $(INSTALL) -m 0644 $$f $(DESTDIR)$(libdir)/$$d || exit 1; \ + done \ + done + clean: distclean: clean