Crontab as alarm clock with ogg123

jack craig jcraig at
Mon Jul 26 21:25:30 UTC 2010

On 07/26/2010 12:59 PM, Robert Arkiletian wrote:
> On Sat, Jul 24, 2010 at 1:51 PM, Frank Cox<theatre at>  wrote:
>> On Sat, 2010-07-24 at 12:55 -0700, Robert Arkiletian wrote:
>>> So I'm thinking it's the same infrastructure to prevent others music
>>> playing when you switch users. But in my case I *want* it to play. Any
>>> ideas?
>> /etc/security/console.perms.d/50-default.perms
> I created a new perms file called 51-default.perms
> and added
> ##
> <sound>=/dev/snd/* /dev/snd
> <console>  0666<sound>  0666 root
> ##
> rebooted (Did I need to?)
> I now notice that the devices in /dev/snd are  crw-rw-rw-+. So Others
> should be able to write to the device.  But I still cannot get cron to
> play an ogg music file unless it's for the person currently  logged
> in.
> I have checked that the file plays fine when normally played so it's
> not an issue with ogg123 or the music file. Here is my crontab line
> (as tried for root)
> 30  12  *  *  1  /usr/bin/ogg123  /root/Mists_of_Time-4T.ogg
> /var/log/cron tells me the command is issued but no sound from speakers.
> Here's the funny part. If I ssh in (as a different user) and run
> ogg123 from command line, sound plays on the sshd server machine. It
> works!! But not if I set it to play using cron.  So basically one must
> be logged in either at the machine or through ssh.
> Also, if nobody is logged in, nothing is heard. But as soon as I log
> into the user who has the cron job running, the sound comes on
> immediately at login. If I then log out while the song is playing,
> sound stops. Log back in and sound comes on again. Obviously, the
> ogg123 process is running but the sound is being disconnected unless
> the user is logged in.
> wondering if udev rules is somehow responsible. Here is
> /etc/udev/rules.d/90-alsa.rules
> ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", \
>    RUN+="/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf
> --initfile=/lib/alsa/init/00main restore /dev/$name"
> ACTION=="remove", SUBSYSTEM=="sound", KERNEL=="controlC*", \
>    RUN+="/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf store
> /dev/$name"
> Any  ideas much appreciated?
i am using crontab to do an alarm clock and it works fine.
you said that you checked a nomral execuiton of the ogg player, but!

maybe in hte crontab ckey paths (known to your shell, but not default in 
crontab) are missing.

my example, ...

/MAILTO=jackc at

# Wakeup call
## disabled until needed again
30 6 * * 1,2,3,4,5 /home/jackc/bin/wakeup

you might add the mailto and see if it mails you any unresolved 
externals msg?

just a wag...

good luck...

Jack Craig
Software Engineer
831.461.7100 x120

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the users mailing list