From owner-freebsd-questions@FreeBSD.ORG Tue Sep 7 01:51:01 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3B2410656E4 for ; Tue, 7 Sep 2010 01:51:01 +0000 (UTC) (envelope-from olivares14031@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7593A8FC1C for ; Tue, 7 Sep 2010 01:51:01 +0000 (UTC) Received: by wyb33 with SMTP id 33so6212190wyb.13 for ; Mon, 06 Sep 2010 18:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=Oo6c4X8lb2RKVeEv9/p0ky6dymDzsnhhC5e/yNOROI4=; b=GtfKXF3d8Sj+UsF1xnNkeTvguQHQJK21etkEfw8iqnaYTvwefrj0jLoChlHVS0BOUT NOjgsNd+qolb6gWR62hSzbQIrjRk8HGSXkgo7l709aYi9+kr8+0DHwz2p1d5JRxS7P1u 9PmdPyImQ17R+WnKDO62T3xxUXrJswJqMqphM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=cOpYiMnSlq6dgs5AKLzSGPNTYWtVPhfjeZBBlGlPVq2tAM+p1R1qeyCtktDBqz7lnE 1Ng37qkKhu3FOGXRKBNXWfTxlmwNbo9fjEGwP/X/21iYbXCC5HxoSq9GF1cPciCuMV7B JZyFSGsGZItpTbOzR0kyajDar6klyH9siXRNU= MIME-Version: 1.0 Received: by 10.216.54.202 with SMTP id i52mr4412344wec.40.1283824260237; Mon, 06 Sep 2010 18:51:00 -0700 (PDT) Received: by 10.216.169.211 with HTTP; Mon, 6 Sep 2010 18:51:00 -0700 (PDT) In-Reply-To: <20100902140113.GA69315@orange.esperance-linux.co.uk> References: <20100830120007.543fa5dd@gumby.homeunix.com> <20100902140113.GA69315@orange.esperance-linux.co.uk> Date: Mon, 6 Sep 2010 20:51:00 -0500 Message-ID: From: Antonio Olivares To: Frank Shute Content-Type: text/plain; charset=ISO-8859-1 Cc: George Davidovich , freebsd-questions@freebsd.org Subject: Re: killall -9 program-name does not work X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2010 01:51:02 -0000 On 9/2/10, Frank Shute wrote: > On Wed, Sep 01, 2010 at 08:32:56PM -0500, Antonio Olivares wrote: >> >> On 8/30/10, RW wrote: >> > On Mon, 30 Aug 2010 03:14:58 +0000 >> > Antonio Olivares wrote: >> > >> >> Dear fellow FreeBSD users, >> >> >> >> I have a cron script that plays music in the morning when I arrive at >> >> work. >> >> >> >> in ~/.xalarm I have two lines, one that calls xterm and one that calls >> >> mplayer and plays a series of music files in a playlist >> >> >> >> crontab -l >> >> has the following >> >> # min hour day-of-month month day-of-week command >> >> # 0-59 0-23 1-31 1-12 0-6 0=sun 1=mon >> >> 00 07 * * 1-5 ~/.xalarm >/dev/null 2>&1 >> >> 30 07 * * 1-5 killall -9 /usr/local/bin/mplayer >/dev/null 2>&1 >> > >> > You don't need the path to mplayer. >> >> It makes no difference. This does not stop mplayer from playing :( >> >> Thanks though for trying to help. >> >> Regards, >> >> Antonio > > Use the command: > > killall -d mplayer > > & see what it's saying. ie. don't direct stout & sterr to /dev/null > > > Regards, > > -- > > Frank > > Contact info: http://www.shute.org.uk/misc/contact.html > > > Frank and other interested folks, Thank you for all your help. I was able to solve the problem using a script provided by George that uses sleep and kill commands respectively. #!/bin/sh /usr/local/bin/ xterm -e /usr/local/bin/mplayer -really-quiet -shuffle -playlist ~/.playlist & PID=$! # all in one line, then sleep 1800 # 1800 is 60*30 play music for 30 minutes, kill $PID # music stops after playing for 30 minutes. The previous commands I had worked for several versions of linux but not on FreeBSD. The above one is for home machine to play music as I wake up, and the following one for work, #!/bin/sh /usr/local/bin/ xterm -e /usr/local/bin/mplayer -really-quiet -shuffle -playlist ~/.playlist & PID=$! # all in one line, then sleep 180 # 180 is 60*3 play music for 3 minutes, kill $PID Thank you all for your help. I had not noticed that killall -9 /usr/bin/mplayer was not stopping mplayer, but machine was shutting down since I had programmed it using cron as root to shutdown at a certain time. Regards, Antonio