<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: I need a perl script to stop and start program in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587237#M745565</link>
    <description>#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;use CGI::Carp qw(fatalsToBrowser);&lt;BR /&gt;use CGI;&lt;BR /&gt;my $query = new CGI;&lt;BR /&gt;&lt;BR /&gt;$bb = system("/home/ntop.sh stop &amp;amp;");&lt;BR /&gt;&lt;BR /&gt;exit($bb); #### This exit terminate the program!!! Nothing past this point is done&lt;BR /&gt;&lt;BR /&gt;$cc = system("/home/ntop.sh start &amp;amp;");&lt;BR /&gt;&lt;BR /&gt;exit($cc);&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;&lt;BR /&gt;You made thimgs complicated using the &amp;amp; to stop in background.&lt;BR /&gt;&lt;BR /&gt;Change to this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;use CGI::Carp qw(fatalsToBrowser);&lt;BR /&gt;use CGI;&lt;BR /&gt;my $query = new CGI;&lt;BR /&gt;&lt;BR /&gt;my $bb = system("/home/ntop.sh stop");&lt;BR /&gt;sleep(10);&lt;BR /&gt;$cc = system("/home/ntop.sh start &amp;amp;");&lt;BR /&gt;exit($cc);&lt;BR /&gt;&lt;BR /&gt;or this:&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;use CGI::Carp qw(fatalsToBrowser);&lt;BR /&gt;use CGI;&lt;BR /&gt;my $query = new CGI;&lt;BR /&gt;&lt;BR /&gt;my $bb = system("/home/ntop.sh stop &amp;amp;");&lt;BR /&gt;wait; # wait for background task to finish&lt;BR /&gt;$cc = system("/home/ntop.sh start &amp;amp;");&lt;BR /&gt;exit($cc);&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 21 Jul 2005 13:24:30 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2005-07-21T13:24:30Z</dc:date>
    <item>
      <title>I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587234#M745562</link>
      <description>hi&lt;BR /&gt;&lt;BR /&gt;I need a perl script to stop and start program:&lt;BR /&gt;&lt;BR /&gt;-------------------------------------------------------&lt;BR /&gt;# stop PROGRAM&lt;BR /&gt;&lt;BR /&gt;     sh /home/ntop.sh stop&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# start PROGRAM&lt;BR /&gt;&lt;BR /&gt;     sh /home/ntop.sh start&lt;BR /&gt;-------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;I'd like first stop the program and start it again using apache &amp;amp; browser.&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;chris&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Jul 2005 17:21:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587234#M745562</guid>
      <dc:creator>'chris'</dc:creator>
      <dc:date>2005-07-20T17:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587235#M745563</link>
      <description>perl -e '$cc = system("/home/ntop.sh start"); exit($cc);'&lt;BR /&gt;&lt;BR /&gt;I trust you can figure out the stop program.</description>
      <pubDate>Wed, 20 Jul 2005 18:11:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587235#M745563</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-07-20T18:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587236#M745564</link>
      <description>thanks,&lt;BR /&gt;&lt;BR /&gt;I've written following perl script:&lt;BR /&gt;&lt;BR /&gt;----------------------------------------------------------&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;use CGI::Carp qw(fatalsToBrowser);&lt;BR /&gt;use CGI;&lt;BR /&gt;my $query = new CGI;&lt;BR /&gt;&lt;BR /&gt;$bb = system("/home/ntop.sh stop &amp;amp;");&lt;BR /&gt;&lt;BR /&gt;exit($bb);&lt;BR /&gt;&lt;BR /&gt;$cc = system("/home/ntop.sh start &amp;amp;");&lt;BR /&gt;&lt;BR /&gt;exit($cc);&lt;BR /&gt;----------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if execute it from command line:&lt;BR /&gt;&lt;BR /&gt;# perl ntop.cgi&lt;BR /&gt;&lt;BR /&gt;then ntop starts,&lt;BR /&gt;&lt;BR /&gt;but via browser, script be executed without errors, but ntop won't start.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# chown www ntop.cgi&lt;BR /&gt;&lt;BR /&gt;doesn't help !&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;chris&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Jul 2005 12:52:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587236#M745564</guid>
      <dc:creator>'chris'</dc:creator>
      <dc:date>2005-07-21T12:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587237#M745565</link>
      <description>#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;use CGI::Carp qw(fatalsToBrowser);&lt;BR /&gt;use CGI;&lt;BR /&gt;my $query = new CGI;&lt;BR /&gt;&lt;BR /&gt;$bb = system("/home/ntop.sh stop &amp;amp;");&lt;BR /&gt;&lt;BR /&gt;exit($bb); #### This exit terminate the program!!! Nothing past this point is done&lt;BR /&gt;&lt;BR /&gt;$cc = system("/home/ntop.sh start &amp;amp;");&lt;BR /&gt;&lt;BR /&gt;exit($cc);&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;&lt;BR /&gt;You made thimgs complicated using the &amp;amp; to stop in background.&lt;BR /&gt;&lt;BR /&gt;Change to this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;use CGI::Carp qw(fatalsToBrowser);&lt;BR /&gt;use CGI;&lt;BR /&gt;my $query = new CGI;&lt;BR /&gt;&lt;BR /&gt;my $bb = system("/home/ntop.sh stop");&lt;BR /&gt;sleep(10);&lt;BR /&gt;$cc = system("/home/ntop.sh start &amp;amp;");&lt;BR /&gt;exit($cc);&lt;BR /&gt;&lt;BR /&gt;or this:&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;use CGI::Carp qw(fatalsToBrowser);&lt;BR /&gt;use CGI;&lt;BR /&gt;my $query = new CGI;&lt;BR /&gt;&lt;BR /&gt;my $bb = system("/home/ntop.sh stop &amp;amp;");&lt;BR /&gt;wait; # wait for background task to finish&lt;BR /&gt;$cc = system("/home/ntop.sh start &amp;amp;");&lt;BR /&gt;exit($cc);&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Jul 2005 13:24:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587237#M745565</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-07-21T13:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587238#M745566</link>
      <description>thanks,&lt;BR /&gt;---------------------------------------------------------------------------------------&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;use CGI::Carp qw(fatalsToBrowser);&lt;BR /&gt;use CGI;&lt;BR /&gt;my $query = new CGI;&lt;BR /&gt;&lt;BR /&gt;print $query-&amp;gt;header;&lt;BR /&gt;print "\n";&lt;BR /&gt;print "\n";&lt;BR /&gt;print "&lt;TITLE&gt;Repair&lt;/TITLE&gt;\n";&lt;BR /&gt;print "&lt;STYLE type="text/css"&gt;\n";&amp;amp;lt;BR /&amp;amp;gt;print "h3 { color: red }\n";&amp;amp;lt;BR /&amp;amp;gt;print "a { text-decoration: none; font: bold 14pt/16pt Ariel, serif }";&amp;amp;lt;BR /&amp;amp;gt;print "a:hover { color: red } /* when mouse is over link */";&amp;amp;lt;BR /&amp;amp;gt;print "&lt;/STYLE&gt;\n";&lt;BR /&gt;print "\n";&lt;BR /&gt;print "\n";&lt;BR /&gt;print "&lt;CENTER&gt;";&lt;BR /&gt;print "&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;";&lt;BR /&gt;print "&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;";&lt;BR /&gt;&lt;BR /&gt;my $bb = system("/home/ntop.sh stop");&lt;BR /&gt;sleep(5);&lt;BR /&gt;$cc = system("/home/ntop.sh start &amp;amp;");&lt;BR /&gt;&lt;BR /&gt;print "";&lt;BR /&gt;print "";&lt;BR /&gt;&lt;BR /&gt;exit($cc);&lt;BR /&gt;---------------------------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;it works excellent from command line,&lt;BR /&gt;but it it doesn't start ntop via browser.  &lt;BR /&gt;&lt;BR /&gt;what's wrong ?&lt;/CENTER&gt;</description>
      <pubDate>Thu, 21 Jul 2005 14:04:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587238#M745566</guid>
      <dc:creator>'chris'</dc:creator>
      <dc:date>2005-07-21T14:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587239#M745567</link>
      <description>Add a &lt;BR /&gt;print "Status: ",$cc,"\n";&lt;BR /&gt;&lt;BR /&gt;After the system call. You should at least then see the exit status. I suspect you are missing environment variables or ntop expects a tty device as stdin. Put probes that write to a file in your ntop.sh script.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Jul 2005 14:55:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587239#M745567</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-07-21T14:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587240#M745568</link>
      <description>I get the output:&lt;BR /&gt;&lt;BR /&gt;Status: 0 ntop&lt;BR /&gt;&lt;BR /&gt;I think the www user has no rights &lt;BR /&gt;to execute "system" via browser, &lt;BR /&gt;because I have in the Apache error log:&lt;BR /&gt;&lt;BR /&gt;[Thu Jul 21 23:43:54 2005] [error] [client 192.168.0.105] Permission denied &lt;BR /&gt;&lt;BR /&gt;do you know howto change that ?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Jul 2005 15:09:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587240#M745568</guid>
      <dc:creator>'chris'</dc:creator>
      <dc:date>2005-07-21T15:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587241#M745569</link>
      <description>Do something like "ls -l /etc" inside your system command as a test.</description>
      <pubDate>Thu, 21 Jul 2005 15:12:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587241#M745569</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-07-21T15:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587242#M745570</link>
      <description># ls -l /etc&lt;BR /&gt;total 602&lt;BR /&gt;-rw-r--r--  1 root  wheel        32 Jul 19 12:55 .directory&lt;BR /&gt;drwxr-xr-x  3 root  wheel       512 Jul 18 22:54 .java&lt;BR /&gt;drwxr-xr-x  2 root  wheel       512 Jul 20 23:02 X11&lt;BR /&gt;lrwxrwxrwx  1 root  wheel        12 Jul 15 23:38 aliases -&amp;gt; mail/aliases&lt;BR /&gt;-rw-r--r--  1 root  wheel     65536 Jul 18 19:04 aliases.db&lt;BR /&gt;-rw-r--r--  1 root  wheel       209 May  8 09:05 amd.map&lt;BR /&gt;-rw-r--r--  1 root  wheel      1234 May  8 09:05 apmd.conf&lt;BR /&gt;-rw-r--r--  1 root  wheel       231 May  8 09:05 auth.conf&lt;BR /&gt;drwxr-xr-x  2 root  wheel       512 Jul 15 23:38 bluetooth&lt;BR /&gt;-rw-r--r--  1 root  wheel       737 May  8 09:05 crontab&lt;BR /&gt;-rw-r--r--  1 root  wheel       108 May  8 09:05 csh.cshrc&lt;BR /&gt;-rw-r--r--  1 root  wheel       481 May  8 09:05 csh.login&lt;BR /&gt;-rw-r--r--  1 root  wheel       110 May  8 09:05 csh.logout&lt;BR /&gt;drwxr-xr-x  2 root  wheel       512 Jul 15 23:38 defaults&lt;BR /&gt;-rw-r--r--  1 root  wheel      4846 May  8 09:05 devd.conf&lt;BR /&gt;-rw-r--r--  1 root  wheel      2071 May  8 09:05 devfs.conf&lt;BR /&gt;-rw-r--r--  1 root  wheel       267 May  8 09:05 dhclient.conf&lt;BR /&gt;-rw-r--r--  1 root  wheel      6621 May  8 09:05 disktab&lt;BR /&gt;-rw-rw-r--  1 root  operator      0 May  8 09:05 dumpdates&lt;BR /&gt;-rw-r--r--  1 root  wheel       142 May  8 09:05 fbtab&lt;BR /&gt;-rw-r--r--  1 root  wheel       391 Jul 15 23:50 fstab&lt;BR /&gt;-rw-r--r--  1 root  wheel       245 May  8 09:05 ftpusers&lt;BR /&gt;-rw-r--r--  1 root  wheel      5904 May  8 09:05 gettytab&lt;BR /&gt;drwxr-xr-x  2 root  wheel       512 Jul 15 23:38 gnats&lt;BR /&gt;-rw-r--r--  1 root  wheel       489 Jul 16 15:09 group&lt;BR /&gt;-rw-r--r--  1 root  wheel        60 Jul 15 22:29 host.conf&lt;BR /&gt;-rw-r--r--  1 root  wheel       146 Jul 20 21:25 hosts&lt;BR /&gt;-rw-r--r--  1 root  wheel      3237 Jul 21 01:39 hosts.allow&lt;BR /&gt;-rw-r--r--  1 root  wheel       111 May  8 09:05 hosts.equiv&lt;BR /&gt;-rw-r--r--  1 root  wheel        99 May  8 09:05 hosts.lpd&lt;BR /&gt;-rw-r--r--  1 root  wheel      5319 May  8 09:05 inetd.conf&lt;BR /&gt;drwx------  2 root  wheel       512 Jul 15 23:38 isdn&lt;BR /&gt;-rw-r--r--  1 root  wheel       837 May  8 09:03 localtime&lt;BR /&gt;-rw-r--r--  1 root  wheel       619 May  8 09:05 locate.rc&lt;BR /&gt;-rw-r--r--  1 root  wheel      1847 May  8 09:05 login.access&lt;BR /&gt;-rw-r--r--  1 root  wheel      6522 May  8 09:05 login.conf&lt;BR /&gt;-rw-r--r--  1 root  wheel     65536 May  8 09:05 login.conf.db&lt;BR /&gt;-rw-r--r--  1 root  wheel       564 May  8 09:05 mac.conf&lt;BR /&gt;drwxr-xr-x  2 root  wheel       512 Jul 17 12:51 mail&lt;BR /&gt;-rw-r--r--  1 root  wheel       106 May  8 09:05 mail.rc&lt;BR /&gt;-rw-r--r--  1 root  wheel        91 Jul 18 19:09 make.conf&lt;BR /&gt;-rw-r--r--  1 root  wheel         0 Jul 16 15:20 make.conf.bak&lt;BR /&gt;-rw-r--r--  1 root  wheel      1087 Jul 16 15:27 manpath.config&lt;BR /&gt;-rw-r--r--  1 root  wheel       946 Jul 16 15:20 manpath.config.bak&lt;BR /&gt;-rw-------  1 root  wheel      1845 Jul 21 00:20 master.passwd&lt;BR /&gt;-rw-r--r--  1 root  wheel      1114 Jul 15 22:29 motd&lt;BR /&gt;drwxr-xr-x  2 root  wheel       512 Jul 15 23:38 mtree&lt;BR /&gt;lrwxrwxrwx  1 root  wheel        23 Jul 15 23:38 namedb -&amp;gt; ../var/named/etc/namedb&lt;BR /&gt;-rw-r--r--  1 root  wheel       783 May  8 09:05 netconfig&lt;BR /&gt;-rwxr-xr-x  1 root  wheel      2362 May  8 09:05 netstart&lt;BR /&gt;-rw-r--r--  1 root  wheel     13696 May  8 09:05 network.subr&lt;BR /&gt;-rw-r--r--  1 root  wheel       365 May  8 09:05 networks&lt;BR /&gt;-rw-r--r--  1 root  wheel      1937 May  8 09:05 newsyslog.conf&lt;BR /&gt;-rw-------  1 root  wheel      1701 May  8 09:05 nsmb.conf&lt;BR /&gt;-rw-r--r--  1 root  wheel       113 Jul 15 22:29 nsswitch.conf&lt;BR /&gt;drwx------  2 root  wheel       512 May  8 09:00 ntp&lt;BR /&gt;-rw-------  1 root  wheel       432 May  8 09:05 opieaccess&lt;BR /&gt;-rw-r--r--  1 root  wheel         0 Jul 15 22:36 opiekeys&lt;BR /&gt;drwxr-xr-x  2 root  wheel       512 Jul 15 23:38 pam.d&lt;BR /&gt;-rw-r--r--  1 root  wheel      1607 Jul 21 00:20 passwd&lt;BR /&gt;-rwxr-xr-x  1 root  wheel      5814 May  8 09:05 pccard_ether&lt;BR /&gt;drwxr-xr-x  6 root  wheel       512 Jul 15 23:38 periodic&lt;BR /&gt;-rw-r--r--  1 root  wheel       177 Jul 18 19:22 periodic.conf&lt;BR /&gt;-rw-r--r--  1 root  wheel      3567 May  8 09:05 pf.conf&lt;BR /&gt;-rw-r--r--  1 root  wheel     22556 May  8 09:05 pf.os&lt;BR /&gt;-rw-r--r--  1 root  wheel       293 May  8 09:05 phones&lt;BR /&gt;drwxr-xr-x  2 root  wheel       512 Jul 15 23:38 ppp&lt;BR /&gt;-rw-r--r--  1 root  wheel      2058 May  8 09:05 printcap&lt;BR /&gt;-rw-r--r--  1 root  wheel       619 May  8 09:05 profile&lt;BR /&gt;-rw-r--r--  1 root  wheel      5807 May  8 09:05 protocols&lt;BR /&gt;-rw-r--r--  1 root  wheel     40960 Jul 21 00:20 pwd.db&lt;BR /&gt;-rw-r--r--  1 root  wheel      2716 May  8 09:05 rc&lt;BR /&gt;-rw-r--r--  1 root  wheel      5298 May  8 09:05 rc.bsdextended&lt;BR /&gt;-rw-r--r--  1 root  wheel       942 Jul 20 21:33 rc.conf&lt;BR /&gt;-rw-r--r--  1 root  wheel      1114 Jul 20 21:25 rc.conf~&lt;BR /&gt;drwxr-xr-x  2 root  wheel      2560 Jul 15 23:38 rc.d&lt;BR /&gt;-rw-r--r--  1 root  wheel      9569 May  8 09:05 rc.firewall&lt;BR /&gt;-rw-r--r--  1 root  wheel      8905 May  8 09:05 rc.firewall6&lt;BR /&gt;-rwxr-xr-x  1 root  wheel      2165 May  8 09:05 rc.resume&lt;BR /&gt;-rw-r--r--  1 root  wheel      5785 May  8 09:05 rc.sendmail&lt;BR /&gt;-rw-r--r--  1 root  wheel      3211 May  8 09:05 rc.shutdown&lt;BR /&gt;-rw-r--r--  1 root  wheel     30905 May  8 09:05 rc.subr&lt;BR /&gt;-rwxr-xr-x  1 root  wheel      2209 May  8 09:05 rc.suspend&lt;BR /&gt;-rw-r--r--  1 root  wheel      2392 May  8 09:05 remote&lt;BR /&gt;-rw-r--r--  1 root  wheel        42 Jul 20 21:25 resolv.conf&lt;BR /&gt;lrwxrwxrwx  1 root  wheel        13 Jul 15 23:38 rmt -&amp;gt; /usr/sbin/rmt&lt;BR /&gt;-rw-r--r--  1 root  wheel      1674 May  8 09:05 rpc&lt;BR /&gt;-rw-r--r--  1 root  wheel     73410 May  8 09:05 services&lt;BR /&gt;-rw-r--r--  1 root  wheel       237 Jul 16 00:04 shells&lt;BR /&gt;drwxr-xr-x  2 root  wheel       512 May  8 09:00 skel&lt;BR /&gt;-rw-------  1 root  wheel     40960 Jul 21 00:20 spwd.db&lt;BR /&gt;drwxr-xr-x  2 root  wheel       512 Jul 15 22:34 ssh&lt;BR /&gt;drwxr-xr-x  2 root  wheel       512 Jul 15 23:38 ssl&lt;BR /&gt;-rw-r--r--  1 root  wheel       367 May  8 09:05 sysctl.conf&lt;BR /&gt;-rw-r--r--  1 root  wheel      1339 May  8 09:05 syslog.conf&lt;BR /&gt;lrwxrwxrwx  1 root  wheel        23 Jul 15 23:38 termcap -&amp;gt; /usr/share/misc/termcap&lt;BR /&gt;-rw-r--r--  1 root  wheel        13 Jul 20 22:48 timezone&lt;BR /&gt;-rw-r--r--  1 root  wheel      7658 May  8 09:05 ttys&lt;BR /&gt;-rw-r--r--  1 root  wheel      2032 May  8 09:05 usbd.conf&lt;BR /&gt;-r--r--r--  1 root  wheel         0 Jul 15 23:42 wall_cmos_clock&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Jul 2005 15:21:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587242#M745570</guid>
      <dc:creator>'chris'</dc:creator>
      <dc:date>2005-07-21T15:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587243#M745571</link>
      <description>Okay, that's rather convincing data that this is not a simple permission problem. Start probing your ntop.sh shell and redirect both stderr and stdout to a logfile.</description>
      <pubDate>Thu, 21 Jul 2005 15:27:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587243#M745571</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-07-21T15:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587244#M745572</link>
      <description>but how can I do this ?&lt;BR /&gt;&lt;BR /&gt;I mean to do this as a root user ?</description>
      <pubDate>Thu, 21 Jul 2005 15:49:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587244#M745572</guid>
      <dc:creator>'chris'</dc:creator>
      <dc:date>2005-07-21T15:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587245#M745573</link>
      <description>I didn't write your ntop.sh and I didn't write ntop so how can I possibly know what you need to do? I do know how to find out and that is to add&lt;BR /&gt;exec 1&amp;gt;&amp;gt;/var/tmp/nlog.txt&lt;BR /&gt;exec 2&amp;gt;&amp;amp;1 to the top of your ntop.sh&lt;BR /&gt;&lt;BR /&gt;You then put plenty of echo in the script and everything inclding stderr will now go to /var/tmp/nlog.txt and you look there for the problems. This is debugging 101.</description>
      <pubDate>Thu, 21 Jul 2005 17:29:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587245#M745573</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-07-21T17:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587246#M745574</link>
      <description>this is ntop.sh script:&lt;BR /&gt;-----------------------------------------------------------------------------------------------------&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;interfaces=''&lt;BR /&gt;&lt;BR /&gt;# User to run ntop as; leave blank for root&lt;BR /&gt;userid='www'&lt;BR /&gt;&lt;BR /&gt;# [IP:]port for serving HTTP; set to '0' to disable&lt;BR /&gt;#http_port='3000'&lt;BR /&gt;&lt;BR /&gt;# [IP:]port for serving HTTPS; set to '0' to disable&lt;BR /&gt;# The certificate is /usr/local/etc/ntop/ntop-cert.pem&lt;BR /&gt;https_port='10.10.3.77:3001'&lt;BR /&gt;&lt;BR /&gt;# Directory for ntop.access.log&lt;BR /&gt;logdir='/var/log'&lt;BR /&gt;&lt;BR /&gt;# Specify any additional arguments here - see ntop(8)&lt;BR /&gt;additional_args=''&lt;BR /&gt;&lt;BR /&gt;#&lt;BR /&gt;# End of user-configurable variables&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;args='-d -L --set-pcap-nonblocking --skip-version-check'&lt;BR /&gt;&lt;BR /&gt;[ ! -z $interfaces ] &amp;amp;&amp;amp; args="$args -i $interfaces"&lt;BR /&gt;[ ! -z $http_port ] &amp;amp;&amp;amp; args="$args -w $http_port"&lt;BR /&gt;[ ! -z $https_port ] &amp;amp;&amp;amp; args="$args -W $https_port"&lt;BR /&gt;[ ! -z $logdir ] &amp;amp;&amp;amp; args="$args -a ${logdir}/ntop.access.log"&lt;BR /&gt;[ ! -z $userid ] &amp;amp;&amp;amp; args="$args -u $userid"&lt;BR /&gt;[ ! -z "$additional_args" ] &amp;amp;&amp;amp; args="$args $additional_args"&lt;BR /&gt;&lt;BR /&gt;case "$1" in&lt;BR /&gt;start)&lt;BR /&gt;  # is it the first time we run ntop&lt;BR /&gt;  [ ! -e /var/db/ntop/ntop_pw.db ] &amp;amp;&amp;amp; {&lt;BR /&gt; # just in case...&lt;BR /&gt; [ ! -d  /var/db/ntop ] &amp;amp;&amp;amp; {&lt;BR /&gt;  echo "Reinstalling database directory"&lt;BR /&gt;  mkdir -p  /var/db/ntop&lt;BR /&gt;  chown -R $userid:$userid  /var/db/ntop&lt;BR /&gt; }&lt;BR /&gt; /usr/local/bin/ntop -u $userid -A || exit 1&lt;BR /&gt; echo "Now we can start ntop!"&lt;BR /&gt;  }&lt;BR /&gt;  if [ -d $logdir ]; then&lt;BR /&gt;    touch ${logdir}/ntop.access.log&lt;BR /&gt;    chown $userid ${logdir}/ntop.access.log&lt;BR /&gt;  fi&lt;BR /&gt;  if [ -x /usr/local/bin/ntop ]; then&lt;BR /&gt;    /usr/local/bin/ntop $args &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&lt;BR /&gt;    echo -n ' ntop'&lt;BR /&gt;  fi&lt;BR /&gt;  ;;&lt;BR /&gt;stop)&lt;BR /&gt;  killall ntop &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&amp;amp; echo -n ' ntop'&lt;BR /&gt;  ;;&lt;BR /&gt;*)&lt;BR /&gt;  echo "Usage: `basename $0` {start|stop}" &amp;gt;&amp;amp;2&lt;BR /&gt;  exit 64&lt;BR /&gt;  ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;exec 1&amp;gt;&amp;gt;/var/tmp/nlog.txt&lt;BR /&gt;exec 2&amp;gt;&amp;amp;1 to the top of your ntop.sh&lt;BR /&gt;&lt;BR /&gt;exit 0&lt;BR /&gt;-----------------------------------------------------------------------------------------------------</description>
      <pubDate>Thu, 21 Jul 2005 18:07:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587246#M745574</guid>
      <dc:creator>'chris'</dc:creator>
      <dc:date>2005-07-21T18:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587247#M745575</link>
      <description>if I put to the top of this srcipt, then I cannot start ntop from command line.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Jul 2005 18:53:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587247#M745575</guid>
      <dc:creator>'chris'</dc:creator>
      <dc:date>2005-07-21T18:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to stop and start program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587248#M745576</link>
      <description>I've written these scripts and it seems to work on freeBSD 6.1 using sudo:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;# ntop startup script&lt;BR /&gt;&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use CGI;&lt;BR /&gt;#use CGI::Carp qw(fatalsToBrowser);&lt;BR /&gt;&lt;BR /&gt;my $query = new CGI;&lt;BR /&gt;my $process = "ntop";&lt;BR /&gt;&lt;BR /&gt;# write the log&lt;BR /&gt;BEGIN&lt;BR /&gt;{&lt;BR /&gt;use CGI::Carp qw(carpout);&lt;BR /&gt;my $errorlog = "/var/tmp/ntop_startup_log.txt";&lt;BR /&gt;open(LOG, "&amp;gt;$errorlog") or die("Unable to open $errorlog: $!\n");&lt;BR /&gt;print LOG "Errors:\n";&lt;BR /&gt;carpout(*LOG);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;$|=1;&lt;BR /&gt;print $query-&amp;gt;header;&lt;BR /&gt;print "\n";&lt;BR /&gt;print "\n";&lt;BR /&gt;print "&lt;TITLE&gt;ntop startup script&lt;/TITLE&gt;\n";&lt;BR /&gt;print "&lt;STYLE type="text/css"&gt;\n";&amp;amp;lt;BR /&amp;amp;gt;print "h3 { color: red }\n";&amp;amp;lt;BR /&amp;amp;gt;print "a { text-decoration: none; font: bold 14pt/16pt Ariel, serif }";&amp;amp;lt;BR /&amp;amp;gt;print "a:hover { color: red } /* when mouse is over link */";&amp;amp;lt;BR /&amp;amp;gt;print "&lt;/STYLE&gt;\n";&lt;BR /&gt;    print "&amp;lt;SCRIPT LANGUAGE = \"JavaScript\"&amp;gt;\n";&lt;BR /&gt;    print "&lt;!-- \n";&lt;BR /&gt;    print "function hideWaitMsg(){&lt;BR /&gt;           document.getElementById('wait_msg_text').style.visibility = 'hidden'; }\n\n";&lt;BR /&gt;    print "// --&gt;\n";&lt;BR /&gt; print "&amp;lt;/SCRIPT&amp;gt;\n";&lt;BR /&gt;print "\n";&lt;BR /&gt;print "&lt;CENTER&gt;";&lt;BR /&gt;print "&lt;BR /&gt;\n";&lt;BR /&gt;print "&lt;DIV id="\&amp;quot;wait_msg_text\&amp;quot;"&gt;pls wait, ntop will be started !&lt;/DIV&gt; \n";&lt;BR /&gt;&lt;BR /&gt;my $return = 'ps -eaf |grep $process |grep -v grep';&lt;BR /&gt;&lt;BR /&gt;my $stop = '/usr/local/bin/sudo /usr/local/www/apache22/cgi-bin/ntop/ntop stop' ;&lt;BR /&gt;&lt;BR /&gt;#if ($return ne "" ) {&lt;BR /&gt;#system($stop) == 0 and die "Stop failed: $!"&lt;BR /&gt;#}&lt;BR /&gt;&lt;BR /&gt;sleep(10);&lt;BR /&gt;&lt;BR /&gt;print "&lt;FONT face="\&amp;quot;arial,helvetica\&amp;quot;" size="2" color="\&amp;quot;#006600\&amp;quot;"&gt;status:&lt;/FONT&gt;\n";&lt;BR /&gt;&lt;BR /&gt;my $start = system('/usr/local/bin/sudo /usr/local/www/apache22/cgi-bin/ntop/ntop start') and die "...";&lt;BR /&gt;&lt;BR /&gt;print "&lt;BR /&gt;&lt;BR /&gt;";&lt;BR /&gt;print "&lt;FONT face="\&amp;quot;arial,helvetica\&amp;quot;" size="2" color="\&amp;quot;#FF0000\&amp;quot;"&gt;&lt;BR /&gt;pls do not forget to shutdown &lt;B&gt;( kill )&lt;/B&gt;, if you're not using &lt;/FONT&gt; \n";&lt;BR /&gt;print "\n";&lt;BR /&gt;print "&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;";&lt;BR /&gt;print "pls wait for 10 seconds before you click on this link:\n";&lt;BR /&gt;print "&lt;BR /&gt;&lt;BR /&gt;";&lt;BR /&gt;print "&lt;A href="\&amp;quot;http://10.41.1.50:3000\&amp;quot;" target="\&amp;quot;_blank\&amp;quot;"&gt;&lt;B&gt;&lt;U&gt;GO TO NTOP&lt;/U&gt;&lt;/B&gt;&lt;U&gt;&lt;/U&gt;&lt;/A&gt;\n";&lt;BR /&gt;print "&lt;BR /&gt;&lt;BR /&gt;";&lt;BR /&gt;print "&lt;A href="\&amp;quot;http://10.41.1.50/cgi-bin/ntop/killntop.cgi\&amp;quot;" target="_blank"&gt;&lt;FONT face="\&amp;quot;arial,helvetica\&amp;quot;" size="3" color="\&amp;quot;#FF0000\&amp;quot;"&gt;&lt;B&gt;&lt;U&gt;KILL NTOP&lt;/U&gt;&lt;/B&gt;&lt;U&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;FONT&gt;&lt;/FONT&gt;\n";&lt;BR /&gt;print "&lt;/CENTER&gt;";&lt;BR /&gt;print "";&lt;BR /&gt;print "";&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and here is the killing script:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;# ntop kill script&lt;BR /&gt;&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use CGI;&lt;BR /&gt;use CGI::Carp qw(fatalsToBrowser);&lt;BR /&gt;&lt;BR /&gt;my $query = new CGI;&lt;BR /&gt;my $process = "ntop";&lt;BR /&gt;&lt;BR /&gt;# write the log&lt;BR /&gt;BEGIN&lt;BR /&gt;{&lt;BR /&gt;use CGI::Carp qw(carpout);&lt;BR /&gt;my $errorlog = "/var/tmp/ntop_kill_log.txt";&lt;BR /&gt;open(LOG, "&amp;gt;$errorlog") or die("Unable to open $errorlog: $!\n");&lt;BR /&gt;print LOG "Errors:\n";&lt;BR /&gt;carpout(*LOG);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;$|=1;&lt;BR /&gt;print $query-&amp;gt;header;&lt;BR /&gt;print "\n";&lt;BR /&gt;print "\n";&lt;BR /&gt;print "&lt;TITLE&gt;kill ntop&lt;/TITLE&gt;\n";&lt;BR /&gt;print "&lt;STYLE type="text/css"&gt;\n";&amp;amp;lt;BR /&amp;amp;gt;print "h3 { color: red }\n";&amp;amp;lt;BR /&amp;amp;gt;print "a { text-decoration: none; font: bold 14pt/16pt Ariel, serif }";&amp;amp;lt;BR /&amp;amp;gt;print "a:hover { color: red } /* when mouse is over link */";&amp;amp;lt;BR /&amp;amp;gt;print "&lt;/STYLE&gt;\n";&lt;BR /&gt;    print "&amp;lt;SCRIPT LANGUAGE = \"JavaScript\"&amp;gt;\n";&lt;BR /&gt;    print "&lt;!-- \n";&lt;BR /&gt;    print "function hideWaitMsg(){&lt;BR /&gt;           document.getElementById('wait_msg_text').style.visibility = 'hidden'; }\n\n";&lt;BR /&gt;    print "// --&gt;\n";&lt;BR /&gt; print "&amp;lt;/SCRIPT&amp;gt;\n";&lt;BR /&gt;print "\n";&lt;BR /&gt;print "&lt;CENTER&gt;";&lt;BR /&gt;print "&lt;BR /&gt;\n";&lt;BR /&gt;print "&lt;DIV id="\&amp;quot;wait_msg_text\&amp;quot;"&gt;pls wait, ntop will be killed !&lt;/DIV&gt; \n";&lt;BR /&gt;print "&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;";&lt;BR /&gt;&lt;BR /&gt;my $return = 'ps -eaf | grep $process |grep -v grep';&lt;BR /&gt;&lt;BR /&gt;my $stop = '/usr/local/bin/sudo /usr/local/www/apache22/cgi-bin/ntop/ntop stop' ;&lt;BR /&gt;&lt;BR /&gt;#if ($return ne "" ) {&lt;BR /&gt;#   system ($stop) and die "...";&lt;BR /&gt;#}&lt;BR /&gt;&lt;BR /&gt;#if ($return ne "" ) {&lt;BR /&gt;#system($stop) == 0 or die "...: $!"&lt;BR /&gt;#}&lt;BR /&gt;&lt;BR /&gt;sleep(3);&lt;BR /&gt;&lt;BR /&gt;if ($stop == -1) {&lt;BR /&gt;    print "failed to execute: $!\n";&lt;BR /&gt;} elsif ($stop &amp;amp; 127) {&lt;BR /&gt;    printf "died with signal %d, %s coredump\n",&lt;BR /&gt;        ($stop &amp;amp; 127),  ($stop &amp;amp; 128) ? 'with' : 'without';&lt;BR /&gt;} else {&lt;BR /&gt;    printf " exited with value %d\n", $stop &amp;gt;&amp;gt; 8;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;print "\n";&lt;BR /&gt;print "&lt;BR /&gt;&lt;BR /&gt;";&lt;BR /&gt;print "&lt;A href="\&amp;quot;http://10.41.1.50/cgi-bin/ntop/ntop.cgi\&amp;quot;" target="_blank"&gt;&lt;B&gt;&lt;U&gt;START NTOP&lt;/U&gt;&lt;/B&gt;&lt;U&gt;&lt;/U&gt;&lt;/A&gt;\n";&lt;BR /&gt;print "&lt;BR /&gt;&lt;BR /&gt;";&lt;BR /&gt;print "&lt;/CENTER&gt;";&lt;BR /&gt;print "";&lt;BR /&gt;print "";&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;maka a great day !&lt;BR /&gt;chris</description>
      <pubDate>Wed, 13 Jun 2007 05:19:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-a-perl-script-to-stop-and-start-program/m-p/3587248#M745576</guid>
      <dc:creator>'chris'</dc:creator>
      <dc:date>2007-06-13T05:19:27Z</dc:date>
    </item>
  </channel>
</rss>

