Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Killall not terminating vlc

80 views
Skip to first unread message

Andy K

unread,
Jan 15, 2015, 10:03:15 PM1/15/15
to
killall vlc is not working.

Meaning it does not kill vlc.

It has worked killing Firefox, urxvt, etc.

Why not ?

#!/bin/bash
#
#
#
#
vlc /root/Sound_Recordings/Puppy_Started.mp3
sleep 5
killall vlc

Rich

unread,
Jan 15, 2015, 11:17:42 PM1/15/15
to
Maybe vlc ignores SIGTERM, which is the default signal sent if you do
not specify something else?

Try with HUP (killall -HUP vlc) or the cannot be ignored KILL (killall
-KILL vlc).

Helmut Hullen

unread,
Jan 15, 2015, 11:37:30 PM1/15/15
to
Hallo, Andy,

Du meintest am 15.01.15:

> killall vlc is not working.

> Meaning it does not kill vlc.

> It has worked killing Firefox, urxvt, etc.

> Why not ?

Just try

killall -9 vlc


Viele Gruesse
Helmut

"Ubuntu" - an African word, meaning "Slackware is too hard for me".

Henrik Carlqvist

unread,
Jan 16, 2015, 1:36:31 AM1/16/15
to
On Fri, 16 Jan 2015 05:18:00 +0100, Helmut Hullen wrote:
> Just try
>
> killall -9 vlc

Both Rich and Helmut have good suggestions, "killall -9" is the same as
"killall -KILL".

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc351(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost

notbob

unread,
Jan 16, 2015, 12:04:39 PM1/16/15
to
On 2015-01-16, Henrik Carlqvist <Henrik.C...@deadspam.com> wrote:
> On Fri, 16 Jan 2015 05:18:00 +0100, Helmut Hullen wrote:
>> Just try
>>
>> killall -9 vlc
>
> Both Rich and Helmut have good suggestions, "killall -9" is the same as
> "killall -KILL".

Yes. Unfortunately, sometimes even that will not work. Try:

#ps aux | grep vlc

This should bring up all current processes for vlc. If vlc shows a Z
in the "stat" column, it means the process has been killed, but not
properly closed by the parent process which spawned it. It's
functionally dead and you cannot eradicate a zombie short of a
reboot. I think you can sometimes re-init a process while there
exists a zombie, but I'm not sure.

See man ps.

nb

Henrik Carlqvist

unread,
Jan 16, 2015, 2:53:12 PM1/16/15
to
On Fri, 16 Jan 2015 17:04:36 +0000, notbob wrote:
> If vlc shows a Z in the "stat" column, it means the process has been
> killed, but not properly closed by the parent process which spawned
> it.

Yeah, those zombie processes might be a little tricky. When the parent
process calls wait when a process has died the process will disappear.
Until then, the process will be a living dead, a zombie. As it has
already been killed once it cannot be killed again. At least those living
dead processes does not consume any RAM or CPU.

> It's functionally dead and you cannot eradicate a zombie short of
> a reboot.

In fact, there is an easier way. If the parent process gets killed all
its child processes will be orphaned. Orphaned processes gets adopted by
the init process (with pid 1) and the init process knows how to wait
for zombies to make them pass away.

If you write a program spawning child processes yourself and don't want
to wait for those child processes at a later occasion there is a trick:

Spawn an extra child process which spawns the working child process and
then immediately exit. Wait for the extra process and then continue. The
working child process will then be orphaned and adopted py the init
process and properly waited for at exit. Zombie avoided!

notbob

unread,
Jan 16, 2015, 3:20:14 PM1/16/15
to
On 2015-01-16, Henrik Carlqvist <Henrik.C...@deadspam.com> wrote:

> In fact, there is an easier way. If the parent process gets killed all
> its child processes will be orphaned. Orphaned processes gets adopted by
> the init process (with pid 1) and the init process knows how to wait
> for zombies to make them pass away.

Ah yes, kill the parent. Lovely. But, don't you have to reboot to
get init to sweep orphans?

nb

Lew Pitcher

unread,
Jan 16, 2015, 3:32:11 PM1/16/15
to
On Friday January 16 2015 15:20, in alt.os.linux.slackware, "notbob"
No. "Sweeping orphans" is part of init(8)'s job.

More specifically, when a process's parent process terminates, the kernel
reparents all of it's remaining children processes to PID 1. init(8) will
wait(2) and reap the status of any terminated process that it owns, and
since it now owns those 'orphan child' processes that have been reparented
to PID 1, it reaps their status as well. That's how it works.


--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

notbob

unread,
Jan 16, 2015, 5:15:47 PM1/16/15
to
On 2015-01-16, Lew Pitcher <lew.p...@digitalfreehold.ca> wrote:

> More specifically, when a process's parent process terminates, the kernel
> reparents all of it's remaining children processes to PID 1. init(8) will
> wait(2) and reap the status of any terminated process that it owns, and
> since it now owns those 'orphan child' processes that have been reparented
> to PID 1, it reaps their status as well. That's how it works.

Thanx, Lew.

nb

Kees Theunissen

unread,
Jan 16, 2015, 8:02:01 PM1/16/15
to
On my system "killall vlc" just kills all my vlc processes.
In the script quoted above the line "sleep 5" and thus the next
line "killall vlc" won't run until the vlc process has terminated.
If you run the vlc program in the background then it will be
killed after 5 seconds.

#!/bin/bash
#
vlc /root/Sound_Recordings/Puppy_Started.mp3 &
sleep 5
killall vlc



Regards,

Kees.

--
Kees Theunissen.

Kees Theunissen

unread,
Jan 19, 2015, 2:36:46 PM1/19/15
to
If your goal is to to quit vlc after the mp3 has been played then try:

vlc --play-and-exit /root/Sound_Recordings/Puppy_Started.mp3
0 new messages