Re: killall -9 program-name does not work
On 9/2/10, Frank Shute fr...@shute.org.uk wrote: On Wed, Sep 01, 2010 at 08:32:56PM -0500, Antonio Olivares wrote: On 8/30/10, RW rwmailli...@googlemail.com wrote: On Mon, 30 Aug 2010 03:14:58 + Antonio Olivares olivares14...@gmail.com 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 21 30 07 * * 1-5 killall -9 /usr/local/bin/mplayer /dev/null 21 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 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: killall -9 program-name does not work
On Wed, Sep 01, 2010 at 08:32:56PM -0500, Antonio Olivares wrote: On 8/30/10, RW rwmailli...@googlemail.com wrote: On Mon, 30 Aug 2010 03:14:58 + Antonio Olivares olivares14...@gmail.com 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 21 30 07 * * 1-5 killall -9 /usr/local/bin/mplayer /dev/null 21 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 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: killall -9 program-name does not work
On 8/30/10, RW rwmailli...@googlemail.com wrote: On Mon, 30 Aug 2010 03:14:58 + Antonio Olivares olivares14...@gmail.com 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 21 30 07 * * 1-5 killall -9 /usr/local/bin/mplayer /dev/null 21 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 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: killall -9 program-name does not work
On Mon, 30 Aug 2010 03:14:58 + Antonio Olivares olivares14...@gmail.com 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 21 30 07 * * 1-5 killall -9 /usr/local/bin/mplayer /dev/null 21 You don't need the path to mplayer. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
killall -9 program-name does not work
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 21 30 07 * * 1-5 killall -9 /usr/local/bin/mplayer /dev/null 21 and ~/.xalarm has #!/bin/sh # /usr/local/bin/xterm -display :0 -bg black -fg white \\ echo -e /usr/local/bin/mplayer -really-quiet -shuffle -playlist ~/.playlist The music starts playing at 7:00 AM, but it does not stop at 7:30. I have a similar setup at home and I did not notice, since I altered root crontab to shutdown machine automatically at 6:00 am. I check manually with top and see that mplayer runs and I try to kill it from command line and I see that I am not the owner of that process so nothing happens. I get the pid of the process and apply killall -9 pid but it does not do it either. How can I stop mplayer from playing at 7:30 am? should I edit ~/.xalarm and remove the xterm command since I have xterm running before it calls out mplayer? Thanks in Advance for suggestions/advice/comments in this matter. Regards, Antonio Math Teacher New Grulla High School http://olivares14031.741.com/index.html ,, /()` \ \___ / | /- _ `-/ ' (/\/ \ \ /\ / / | `\ O O ) /| `-^--'` ' (_.) _ ) / `.___/`/ `-' / . __ / __ \ |O)))==) \) / '`--' `.__,' \ || \ / /\ __( (_ / \__/ ,' ,-' | `--{__) ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org