Quantcast
Channel: Question and Answer » startup
Viewing all articles
Browse latest Browse all 33

Run mate-terminal on startup as root without password

$
0
0

I am using Linux Mint 17. I want to run mate-terminal on startup as root without need to type password (I want it to perform automatically) and execute python script in it without closing terminal window (python script is server and runs infinitely). So far i have got something like this which i added to startup programs (if I added this to /etc/init then the terminal window doesn’t show):

mate-terminal --working-directory=/home/user/folder_with_script -e "python3 ./server.py"

And this works correctly, means at startup it opens terminal and run in it python script. Now i need to run this script as a root user (now it is executed just as me). I have tried something like this:

mate-terminal --working-directory=/home/user/folder_with_script -e "sudo python3 ./server.py"

But then i need to type in terminal password. And i don’t want to do that, I want to this to do automatically. So i come with another solution (which is ugly, but I just want this to work):

echo 'pass' | sudo -S -H mate-terminal --working-directory=/home/user/folder_with_script -e "sudo python3 ./server.py"

But now nothing happens.

So my question is how can i do this and also is there any way to check why startup program isn’t executed?


Viewing all articles
Browse latest Browse all 33

Trending Articles