*RESOLVEDCorrect "working" way to run shell script at logon?

Archived topics about LMDE 1
Forum rules
hogfan
Level 2
Level 2
Posts: 71
Joined: Fri Apr 20, 2012 10:08 pm

*RESOLVEDCorrect "working" way to run shell script at logon?

Postby hogfan » Sun May 06, 2012 1:04 am

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:

viewtopic.php?f=190&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
Last edited by hogfan on Sun May 06, 2012 11:24 am, edited 1 time in total.

User avatar
Danko8321
Level 4
Level 4
Posts: 206
Joined: Thu Sep 22, 2011 2:03 pm
Location: Colombia

Re: Correct "working" way to run shell script at logon?

Postby Danko8321 » Sun May 06, 2012 1:43 am

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:

Code: Select all

ls -l /home/jeremy/.conkyrc


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.
Cheer up! Things are getting worse at a slower rate.

User avatar
äxl
Level 5
Level 5
Posts: 524
Joined: Fri Apr 06, 2012 6:14 am
Location: Germany

Re: Correct "working" way to run shell script at logon?

Postby äxl » Sun May 06, 2012 3:32 am

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 ;)
My Linux history: Ubuntu 10.04 - 10.10 - LMDE 201109 - UP4 My sources.list/preferences

Computers is not science. And it's not magic - it's something in between.

hogfan
Level 2
Level 2
Posts: 71
Joined: Fri Apr 20, 2012 10:08 pm

Re: Correct "working" way to run shell script at logon?

Postby hogfan » Sun May 06, 2012 8:39 am

@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

hogfan
Level 2
Level 2
Posts: 71
Joined: Fri Apr 20, 2012 10:08 pm

Re: Correct "working" way to run shell script at logon?

Postby hogfan » Sun May 06, 2012 8:42 am

@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

hogfan
Level 2
Level 2
Posts: 71
Joined: Fri Apr 20, 2012 10:08 pm

Re: Correct "working" way to run shell script at logon?

Postby hogfan » Sun May 06, 2012 11:24 am

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

User avatar
Danko8321
Level 4
Level 4
Posts: 206
Joined: Thu Sep 22, 2011 2:03 pm
Location: Colombia

Re: Correct "working" way to run shell script at logon?

Postby Danko8321 » Sun May 06, 2012 3:52 pm

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! :lol: 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.
Cheer up! Things are getting worse at a slower rate.


Return to “Archive”

Who is online

Users browsing this forum: No registered users and 0 guests