In a bash script that is called with sudo i am calling:
/usr/bin/firef开发者_StackOverflowox -new-tab http://stackoverflow.com
but then i get the message:
Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system
this is, i guess, because the script is called by sudo and firefox by the normal user. if i would call the command without sudo it works.
so how can i switch back to the normal user in a sudo called script?
using sudo again inside your script.
sudo -u user -H /usr/bin/firefox -new-tab http://stackoverflow.com
This post might answer your question
精彩评论