Posted on 1998-06-19
Need some help with audio device in Solaris 2.4 running on sparc-10.
Using audioplay command in shell scripts to play warning sound under certain conditions.
# audioplay /usr/demo/SOUND/sounds/doorbell.au
Unless the script is run by root or the user who is currently logged in on the console then permission is denied for the audio device "/dev/audio". The audio device only has rw permission and is owned by the user who is logged onto the console.
# ls -l /dev/audio
lrwxrwxrwx 1 root root 12 Feb 2 1997 /dev/audio -> /dev/sound/0
# ls -l /dev/sound/0
lrwxrwxrwx 1 root root 42 Feb 2 1997 /dev/sound/0 -> ../../devices/audio@1,f7201000:sound,audio
# ls -l /devices/audio@1,f7201000:sound,audio
crw------- 1 <loginName> sysadmin 28, 0 Feb 2 1997 /devices/audio@1,f7201000:sound,audio
The scripts are run by cron and cannot be run as root or as the user who is logged onto console.
The console login is always the same so to get round this for now I have added the following to the console login users .profile:
chmod g+w /devices/audio@1,f7201000:sound,audio.
However this will fail if the sparc is rebooted at any time without a login taking place on the console (a remote re-boot for example), as permission will be denied.
This is the question:
Is there any way to set the permissions of the audio device regardless of who logs into the console.