Crontab as alarm clock with ogg123

Robert Arkiletian robark at
Mon Jul 26 19:59:46 UTC 2010

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

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


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

Any  ideas much appreciated?

Robert Arkiletian
Eric Hamber Secondary, Vancouver, Canada

More information about the users mailing list