/etc/profile ignored on login

Hi. We’re maintaining a few computers at work, that multiple people use and they all have their own user accounts. The problem is that many don’t logout, so this all stays in RAM and the computer becomes slow.

So I’m trying to implement automatic logout after, let’s say 30 minutes of inactivity.

This is my autologout script: http://pastebin.com/zLDWdsQP
It’s marked as executable and it works ok if I run it from the terminal, but I can’t get it to be executed on user login.

First I tried to use lightdm for that. I added this line in the “greeter” configuration:

no success. I also tried putting the script to /etc/profile (every answer on this topic mentions that file), but again nothing happens. :frowning:

This would be my /etc/profile file: http://pastebin.com/reMNXEx5

Notice the call in the end.


there might be something for you here:

I’ve found that question before… tried again… doesn’t work. Does the script need to be modified in some way?


try doing the following via the terminal (Ctrl + Alt + t):

sudo apt-get install autolog

sudo cp /etc/autolog.conf /etc/autolog.conf.orig

sudo vi /etc/autolog.conf

and read through this:


I hope it helps!. :smiley:

Damnit! What’s wrong with me?!

This looks like even better solution, but also not working here. :frowning:


could you not get this http://pastebin.com/zLDWdsQP to autostart if you add it to startup applications?. :smiley:

That worked, but it’s not what I need.

That’s why I wanted to put it in /etc/profile, because I need this for all users not just me. If I put it in the Startup Applications it only works for me.

Have you already set-up your other accounts?, maybe it will work for them all if you do?. :smiley:

The other alternative is to add it to each users startup apps as you assign the new user names?. :smiley:

nope, adding it in Startup Applications only works for the user where you set this. our organization is formed of more than 200 coo-workers and we use ldap logins, so I would need to set this for a lot of accounts. why can’t I just put the script in some file, like /etc/profile and it would work globally?


start here:


I can’t really help you much more as I have never done it myself!. :smiley:

If anybody will run into this problem please make your life easier and read this: