[pskmail] Re: cron to start pskmail server

  • From: John Douyere <vk2eta@xxxxxxxxx>
  • To: Unname <pskmail@xxxxxxxxxxxxx>
  • Date: Tue, 3 Jun 2014 19:18:01 +1000

I use Rein's script below that checks Fldigi's activity. So the maximum
time it will be dead for is 3 minutes plus restart time. Works well here at
VK2ETA-1.

I almost never get Fldigi lock-ups when just listening, but I do get a few
rare ones when in a session. I use Fldigi 3.21.41 under Lubuntu 12.04.

Regards,

John



#! /usr/bin/perl -w

use File::stat;
use Time::localtime;

my $thing = shift(@ARGV);
my $mode = 1;
 if (defined $thing) {
# print "$thing\n";
 $mode = 0;
 }

# fldigi status file
$file = "$ENV{HOME}/.fldigi/status_log.txt";
 if (-e "$ENV{HOME}/.pskmail/fldigirunning") {
`rm $ENV{HOME}/.pskmail/fldigirunning`;
 }
$pid = fork();

if ($pid == 0) {
 # spawning a child running the restarter...
# print "starting child process \n";

();
 while (1) {
 $tm = ctime(time());
 print "Starting at $tm \n";
 # print "killing the server\n";
`killall rflinkserver.pl`;
 sleep 4;
# print "killing fldigi \n";
 `killall fldigi`;
 sleep 4;

 `touch $ENV{HOME}/.pskmail/fldigirunning`;

`~/fldigi -i > /dev/null &`;
 sleep 10;
 `lxterminal -e pskmail_server > /dev/null &`;
  $tm = ctime(time());

 while (-e "$ENV{HOME}/.pskmail/fldigirunning") {
 sleep 30;
}
 }
 } else {
 sleep 10;
 `touch $ENV{HOME}/.fldigi/status_log.txt`;
# print "starting monitor process\n";
 while (1) {
 $td = time();
 $update = $td - (stat($file)->mtime);
 # print $update, "\n";

if ($update > 300) { # max. 3 minutes...
 $dt = ctime(time());
 print "Fldigi died, restarting at $dt \n";
 `killall  rflinkserver.pl`;
`killall  pskmail_server`;
 sleep 4;
 `killall  fldigi`;
 sleep 2;
 if (-e "$ENV{HOME}/.pskmail/fldigirunning") {
 `rm $ENV{HOME}/.pskmail/fldigirunning`;
}
#Make sure it is updated now to avoid restart overlap
 `touch $file`;
 }
 sleep 10;  # look every 10 seconds

}
 }

exit (0);


On Tue, Jun 3, 2014 at 7:01 PM, Ian Bennett <ibennett@xxxxxxxxxx> wrote:

> "Actually, as fldigi is such complete crap..."
> Interesting comment about a program that is used throughout world by
> millions (??) of people on
> Windows, Linux and MacOS, without resorting to Java.
> If fldigi is locking up, check your installation. I'll bet various part of
> my anatomy that you are
> getting RF into your radio to computer connection.
>
> Ian
> VK1IAN
>
> On 03/06/14 18:20, Pär Crusefalk wrote:
> > That is a good idea. Actually, as fldigi is such complete crap I'd like
> > a script that can check if fldigi is locked up or completely crashed and
> > relaunch it every hour or so (it's always crashed when I check the
> > server). Wasn't there such a function a while back? Anyone happen to
> > have a script somewhere I can modify?
> >
> > 73, Per
> > sm0rwo
> >
> >
> >
> > A Mulder (Redacted sender amulder@xxxxxxxxx for DMARC) skrev 2014-06-03
> > 09:58:
> >> Hello Greg,
> >>
> >> Try adding DISPLAY=:0 to the top of your cron file instead.
> >>
> >> Regards,
> >>
> >> Alex
> >> --------------------------------------------
> >> On Mon, 6/2/14, Greg <kb1ncj@xxxxxxxxx> wrote:
> >>
> >>  Subject: [pskmail] cron to start pskmail server
> >>  To: "pskmail@xxxxxxxxxxxxx" <pskmail@xxxxxxxxxxxxx>
> >>  Date: Monday, June 2, 2014, 8:40 AM
> >>
> >>  I am attempting to get server to
> >>  start in cron but as of yet only get a terminal with no
> >>  output. Any help appreciated!
> >>
> >>  Using
> >>
> >>  export DISPLAY=:0 && lxterminal -e "pskmail_server"
> >>
> >>  where "pskmail_server" (without quotes) works correctly in a
> >>  terminal now. Just not with the cron command.
> >>
> >>  Greg
> >>  KB1NCJ
> >>
> >>
> >>
> >
> >
> >
>
>

Other related posts: