I have Ubuntu 12.04 installed on my PC, recently I have edited /etc/passwd
and changed
user1:x:00:00:user1,,,:/home/user1:/bin/bash
to give root permission to user1 and the system always need to login as root, for running some custom software.
Now it seems the sound is not working, the volume icon is disabled. I understand that the pulseaudio
demon can't be run as root that's why the audio is not working. How can I resolve it, like set the permission of pulseaudio to run as root.
When I type the command
/usr/bin/pulseaudio --start
Giving me the output
W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
E: [autospawn] core-util.c: Home directory /home/user1 not ours.
W: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
E: [pulseaudio] main.c: Failed to acquire autospawn lock
Edit
Solution for problem:
I have fixed the problem by disable root checking for pulseaudio equalizer
sed -i 's/exit 1/#exit1/g' /usr/bin/pulseaudio-equalizer
adduser user1 pulse-access
but still the sound cannot enabled. – Haris Mar 21 '16 at 08:12/etc
under version control if you haven't already - check outetckeeper
. If you don't want to do that, at least back up system files in/etc
before messing with them. I'd revert back to the original version if possible. And as people have mentioned, editing passwd files is rarely necessary anyway. Second, PA autospawns by default, so you normally should not need to run it. Third, running PA as root changes permissions and messes stuff up, which I recently found out the hard way. See https://unix.stackexchange.com/q/265043/4671. – Faheem Mitha Mar 21 '16 at 17:27pavucontrol
will run as user. If it doesn't, paste the error message it gives, and try starting PA as user. Also paste the output ofgroups
for your user, please. – Faheem Mitha Mar 21 '16 at 17:29root adm cdrom sudo audio dip plugdev lpadmin sambashare
– Haris Mar 21 '16 at 17:51https://unix.stackexchange.com/questions/473769/sound-doesnt-work-properly-in-root-but-does-in-normal-user – Scorpion Oct 07 '18 at 17:05