1
I need to run the following command sudo xhost SI:localuser:root
every time I start a machine of mine. So I'd like automate this process. I'm using Ubuntu 12.04 LTS for this.
I tried put this command on my file /etc/rc.local
but it isn't working, because when I run xhost
should appear:
SI:localuser:<myUser>
SI:localuser:root
The file /etc/rc.local
is the following:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
xhost SI:localuser:root
exit 0
Am I missing something?
*PS.: as suggest on the comments** The thing I'm tying to do is described on this question here. Can I do this on a better way?
Is that the entire
/etc/rc.local
? You don't have a shebang line? – terdon – 2013-03-28T17:18:20.370I will put the complete fileˆˆ – GarouDan – 2013-03-28T17:19:32.727
I think this might need to be asked on Ask Ubuntu...
– horIzoN – 2013-03-28T17:19:54.783Why do you need to add
root
to the access list? – user1686 – 2013-03-28T17:19:55.567@nerof61 Linux questions are welcome here. Especially if grawity has noticed them :). – terdon – 2013-03-28T17:20:13.173
I know, just thinking he would get direct answers from pro's at Ask Ubuntu. – horIzoN – 2013-03-28T17:21:02.617
Well, looks like superuser question to me, but I will wait some time after migrate it to AskUbuntu. – GarouDan – 2013-03-28T17:24:02.513
@grawity, I need to run a cron as root and this cron (after other things) should open firefox. The problem is withou this firefox crash when trying to open. – GarouDan – 2013-03-28T17:25:06.690
1No, the problem is that you're trying to run Firefox as root... – user1686 – 2013-03-28T17:27:28.093
2
Why would a cron job need to open a graphical web browser as the
– terdon – 2013-03-28T17:31:37.807root
user? This is sounding more and more like an XY problem. What exactly are you trying to do here?@terdon, I think is a good time to write another question, saying what I'm really trying to doˆˆ – GarouDan – 2013-03-28T17:45:37.300