Page 1 of 1
*RESOLVEDCorrect "working" way to run shell script at logon?
Posted: Sun May 06, 2012 1:04 am
by hogfan
Ok I have been fighting with this for the last several days and have gotten any recent replies in this thread I posted over in the software forum:
http://forums.linuxmint.com/viewtopic.p ... 0&t=101150
What is the proper way make a shell script run automatically at login in LMDE 12? I am using Cinnamon desktop. I have tried 3 - 4 different ways and I can't for the life of me get my conky_autostart script to run and launch
conky at logon. I tested with gimp as well, so I know it's the script not running, rather than just a bad
conky command. The command in my shell script works fine when launched manually from the terminal, but refuses to
autostart at logon. I've tried through creating a debian
autostart file, as well as through gnome-session-properties to no avail. Any insight on this one is extremely appreciated.
-hogfan
Re: Correct "working" way to run shell script at logon?
Posted: Sun May 06, 2012 1:43 am
by Danko8321
I read your post; please don't double post.
I'm not a forum admin, so I won't nag you more than that. However, for what I've seen, your
Conky script launches just fine when runnig under sudo, so it might be a permissions problem.
Please post back the output of the following command:
and also
Code: Select all
ls -l /home/jeremy/.autostart_conky.sh
I wont rat you out to an admin because I can see you are truly desperate for help, but *please* do not double post again.
Re: Correct "working" way to run shell script at logon?
Posted: Sun May 06, 2012 3:32 am
by äxl
hogfan, there's no need to use LSB scripts. Use ~/.profile or /etc/rc.local to put the command line in.
Plus:
http://letmebingthatforyou.com/?q=autostart%20linux
Re: Correct "working" way to run shell script at logon?
Posted: Sun May 06, 2012 8:39 am
by hogfan
@danko8321
Here is the requested terminal output:
Code: Select all
jeremy@mintbook ~ $ ls -l /home/jeremy/.conkyrc
-rw-r--r-- 1 jeremy jeremy 2421 May 3 19:33 /home/jeremy/.conkyrc
jeremy@mintbook ~ $ ls -l /home/jeremy/.autostart_conky.sh
-rwxr-xr-x 1 root root 62 May 4 10:29 /home/jeremy/.autostart_conky.sh
jeremy@mintbook ~ $
As you can see, the .autostart_conky.sh script does have the appropriate execute permissions.
In regards to the double-post, I was not intending to double-post, and didn't think that I was. This thread was asking how to make
autostart work period, since I wasn't able to get anything to
autostart after trying 3 - 4 different things I found googling. My other thread just kind of died out, and linking to that thread was more about just showing people the things I had already tried rather than re-typing them in this thread. I appreciate the assistance. This issue has been driving me crazy as it's such a "basic" task but it's taken me several days and I still can't resolve.
-hogfan
Re: Correct "working" way to run shell script at logon?
Posted: Sun May 06, 2012 8:42 am
by hogfan
@axl
I have tried adding the command to the /etc/rc.local, saving, and restarting the machine, but that didn't seem to work either. I there a command I need to run to update symbolic links or something after editing that file? Thanks.
-hogfan
Re: Correct "working" way to run shell script at logon?
Posted: Sun May 06, 2012 11:24 am
by hogfan
Well, I got it working finally. Strange thing is it didn't work when running gnome-session-properties at terminal......but browsing to Preferences --> Startup Applications i then Cinnamon menu did work. Strange. I still don't understand why none of the other methods worked, but I am satisfied and will marked this thread resolved.
-hogfan
Re: Correct "working" way to run shell script at logon?
Posted: Sun May 06, 2012 3:52 pm
by Danko8321
hogfan wrote:Well, I got it working finally. Strange thing is it didn't work when running gnome-session-properties at terminal......but browsing to Preferences --> Startup Applications i then Cinnamon menu did work. Strange. I still don't understand why none of the other methods worked, but I am satisfied and will marked this thread resolved.
-hogfan
I can give you an answer to why it didn't work before (can't give you an answer regarding how it did now though). Take a close look at this:
...
Code: Select all
-rwxr-xr-x 1 root root 62 May 4 10:29 /home/jeremy/.autostart_conky.sh
jeremy@mintbook ~ $
The ownership is set to root!
That was the reason why I asked for the output, with that ownership you could only start the script as root. Use this command to fix that:
Code: Select all
sudo chown jeremy: /home/jeremy/.autostart_conky.sh
Which will set the ownership back to you and allow you to start the script without being root and allow you to start it (theoretically speaking) in any session. Remember ownership as well as permissions next time and don't always use sudo; it changes ownership to root. My two cents.
Cheers. Danko.