Results 1 to 8 of 8
Hello everyone,
my system has an autologin as root defined by custom.conf which is located in /etc/gdm :
Code:
[daemon]
TimedLoginEnable=false
AutomaticLoginEnalbe=true
TimedLogin=root
AutomaticLogin=root
TimedLoginDelay=30
And I would like to ...
- 05-05-2011 #1Just Joined!
- Join Date
- May 2011
- Posts
- 38
Autostart program as root after autologin
Hello everyone,
my system has an autologin as root defined by custom.conf which is located in /etc/gdm :
And I would like to have the program "expfit_spifunc2" executed after the auto login. So, I have added "xterm_expfit.desktop" inside of /root/.config/autostartCode:[daemon] TimedLoginEnable=false AutomaticLoginEnalbe=true TimedLogin=root AutomaticLogin=root TimedLoginDelay=30
"xterm_expfit.desktop" code:
And last, the "test.sh" is shown bellow:Code:[Desktop Entry] Encoding=UTF-8 Version=0.9.4 Type=Application Name=xterm_expfit Comment=expfit_spifunc2 Exec=xterm -geometry 80x24-30+0 -e /home/levmar-2.5/test.sh StartupNotify=false Terminal=false Hidden=false
However, it does not even open the xterm to run the program. Could anyone give me any idea about what could be happening?Code:#!/bin/bash /home/levmar-2.5/expfit_spifunc2 bash
Thanks for your attention!
Frederico Lima
- 05-05-2011 #2
One of the lines is "Terminal=false". I haven't tried this exact thing, but I would expect that variable should be set to true if you want an actual terminal to be shown.
- 05-05-2011 #3Just Joined!
- Join Date
- May 2011
- Posts
- 38
Thanks for the suggestion,
but I have just changed it to "Terminal=true" and nothing changed...
- 05-05-2011 #4
I've never tried running a script that way. Have you tried System/Preferences/Startup Programs, and adding your script to that list? It should run as root from there, by just putting in the path to the script, as long as the script has the executable bit set. I don't know what distro you're running, so this might not work, but it should work for any Debian-derived distro.
- 05-05-2011 #5Just Joined!
- Join Date
- May 2011
- Posts
- 38
Sgosnell, as you have seen in the other thread (Auto execute program after booting), I was trying to execute a script with an user but I got stuck since the program was not executed without someone typing the password. That way, I had the whole graphical interface and I could use:
Settings -> Session and Startup -> Application Autostart
The autologin as root only gives me a terminal and nothing else. That is why I have done it this way.
By the way, I have been using Ubuntu 9.10 karmic.
- 05-05-2011 #6
In Ubuntu, you should be able to go to System/Preferences/Startup Programs and add your script to the list of startup programs. These should run as root without needing a password. You can also copy the script to /usr/bin, or /usr/local/bin and have it run at startup this way. Running it from /home/user might be a problem in Ubuntu, I can't recall exactly, but putting it in /usr/bin should work.
- 05-06-2011 #7Just Joined!
- Join Date
- May 2011
- Posts
- 38
I have copied the "test.sh" inside of both folders which you have mentioned and changed the path in the "xterm_expfit.desktop" but it does not work.
I can run the "test.sh" using root user exactly the way it should be. However, I have tested to autostart only an xterm but it does not work neither. It seems that when I am doing the autologin as root, the autostart does not work anymore.
- 05-10-2011 #8Just Joined!
- Join Date
- May 2011
- Posts
- 38
So, I have got the answer for my question and I would like to share it here.
When Ubuntu does the autologin with user "root", it apparently does not run the file "xterm_expfit.desktop". So, the idea was to edit the file /root/.bashrc
I have only added in the last line:
/home/ebv/levmar-2.5/test.sh
I have deleted the last line of test.sh and it looks like this now:
The lineCode:#!/bin/bash /home/levmar-2.5/expfit_spifunc2
seemed to be calling .bashrc again and there was an infinite loop.Code:bash


Reply With Quote