Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Sep 2021 17:00:36 -0700
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Cy Schubert <Cy.Schubert@cschubert.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: killall, symlinks, and signal delivery?
Message-ID:  <20210908000036.GA24175@troutmask.apl.washington.edu>
In-Reply-To: <6C88F561-B045-4D09-B61D-D91096AF0C4B@cschubert.com>
References:  <20210907224242.GA19450@troutmask.apl.washington.edu> <6C88F561-B045-4D09-B61D-D91096AF0C4B@cschubert.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 07, 2021 at 04:20:30PM -0700, Cy Schubert wrote:
> On September 7, 2021 3:42:53 PM PDT, Steve Kargl <sgk@troutmask.apl.washington.edu> wrote:
> >I have stumbled about a quandry, which I hope someone
> >can shed some light upon.  In my day job, I often
> >generate a sequence of images and display these images
> >with ImageMagick's display command.  From my csh prompt,
> >a quick and dirty foreach() loop
> >
> >% foreach i (*.png)
> >> display $i &
> >> sleep 3
> >> end
> >
> >Instead of moving the cursor to each image and hitting
> >'q' to close the images.  I normally kill all of the
> >processes at one time.  This used to work:
> >
> >% killall display
> >
> >Now I geit, for example, 
> >
> >% display z.miff &
> >% killall display
> >No matching processes belonging to you were found
> >% ps -Ukargl | grep display
> >19463  1  S    0:00.02 display z.miff (magick)
> >19465  1  S+   0:00.00 grep display
> >% ls -l /usr/local/bin/display 
> >lrwxr-xr-x  1 root  wheel  - 6 Jun  1 14:18 /usr/local/bin/display@ -> magick
> >
> >So, there are two possibilities:
> >(1) display was once an independent program and not a
> >    symlink to magick.  Thus, killall just worked. Or,
> >(2) killall no longer works because command associated
> >    with process 19463 is not really 'display' and the
> >    symlink isn't resolved to actually kill 'magick'.
> >
> >So, just chekcing (2), here.  Is this a change in behvior
> >for FreeBSD?
> >
> 
> It's likely your app is replacing its process name
> (argv[0]) to something else. ps auxww may give you a
> hint what it might be now.

Yes, that's likely.  So, it could be a change in behavior
for ImageMagick.  Your suggested ps command doesn't provide
anything new.  ps shows the command that I entered, namely,
'display coarse_sand.jpg'.  But, it also shows '(magick)',
which is the actual name of the program.  I'm guessing
argv[0] = "magick".

% ps
24333  7  I     0:00.43 display coarse_sand.jpg (magick)

% killall magick

does the job of killing the displayed image.

-- 
Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210908000036.GA24175>