* On 2024 21 Feb 12:42 -0600, David Wright wrote:
> On Mon 19 Feb 2024 at 13:26:17 (-0600), Nate Bargmann wrote:
> >
> > After seeing this twice this morning I recalled that I have a cron entry
> > to kill the 'rec' program. This was to break up audio files into hourly
> > segments when recording an amateur radio event. This was the cron
> > command:
> >
> > # Rotate sound recorder files
> > 00 * * * * /usr/bin/pkill -f rec > /dev/null 2> /dev/null
> >
> > On a hunch I commented that line and Voila! the daemon ran through the
> > next hour change and is still running as expected. The man page states
> > that the '-f' option matches against the full command line, not just the
> > process name. So, looking at the gnome-keyring-daemon command line:
> >
> >1857 ?SLsl 0:00 /usr/bin/gnome-keyring-daemon --foreground
> > --components=pkcs11,secrets --control-directory=/run/user/1000/keyring
> >
> > I see that the 'rec' in 'directory' provided the match! Confirmed with
> > pgrep:
> >
> > $ pgrep -f rec
> > 1857
> >
> > It looks like the solution for the future will be to change the cron
> > line to:
> >
> > 00 * * * * /usr/bin/pkill -f /usr/bin/rec > /dev/null 2> /dev/null
>
> I can't get that to work here. When I kill rec, it just dies. Is pkill
> sending SIGTERM, which appears to be the default? Nor can I find this
> documented—though the sox docs are lengthy, so I might have missed it.
>
> I can use SIGUSR1 with arecord, and that works perfectly.
It gets restarted by a script called by the 'tlf' amateur radio logging
program. The script is:
https://github.com/Tlf/tlf/blob/master/scripts/soundlog
It's a hack!
- Nate
--
"The optimist proclaims that we live in the best of all
possible worlds. The pessimist fears this is true."
Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819
signature.asc
Description: PGP signature