Starting Script at Login

Hello All,

I had a question about starting scripts when my user logs into the system. The script is just a simple bash script that runs an infinite while loop that does a who | grep <USERNAME> and if it returns zero then executes a program and then exits the script.

First I tried adding my script to the /etc/init.d dir but after login I could not find the script running anywhere using ps -ef and/or ps -aux. Then I tried adding the script into the /etc/init.d/rc.d* directories but also could not find it running. It wasn’t until I decided to use the “Startup Applications” option in the “Control Center”. So my question about that is, where does that application add those apps to so they start at login time? I could not find any “links”, etc… for that script in any of those dirs?

Also, one other question.
How do I create a user that I can use for SSH and su to if need be, but not have the option to login to that user at boot time. Before I created the other user, it would just automatically login to the my “everyday” user account, which is what I want. But now with the new user I get prompted to select which user I want to login in to.

Thanks in Advance,
Matt

Hi mmartin0926,

If your Users login to KDE, you can put your script into home/user/.kde4/Autostart
For other logins, sorry, don’t know (yet?).

About the autologin:
You can setup this in yast, users+groups. (not sure about the English terms, here).
There’s some “options for experts” => go to “settings for login”…
You can choose a user for autologin.

Good luck.
And please let us know if you find out a better way than I described. I could like to use it, too.

Edit the file /etc/sysconfig/displaymanager , look for DISPLAYMANAGER_AUTOLOGIN="" and put the username of the user that you want to autologin between the quotes.:
on KDE:


kdesu kwrite

on GNOME:


gnomesu gedit

BTW: my guess is that you are doing all this to improve security; well, autologin does not IMHO.

Hey kasi,

Thanks for the reply. Sorry, i forgot to mention that, it’s GNOME (gdm). Yea I did see that “autologin” option as I was cruising around YaST and Control Center, but I wanted to see if there was a way to, lets say “exclude” certain usernames from even showing at login screen. But I guess if it’s automatically logging that user in, then guess I really don’t have to worry about that then.

I am going to keep looking around for that option though and I’ll let you know what I find.
Also, it seems that KDE offers soooo much more in terms of desktop and GUI features though. I saw an app for KDE in Software Management that’s called “kdm — KDE Login and Display Manager” which seems useful, along with a few other Display type Managers for KDE.
I did find though one for GNOME called “gdm-branding-upstream” which looks like it’s another version of the GNOME’s Display Manager. So I may install that and see what it can do.

Thanks,
Matt

Knurpht,

Thanks for the reply. Yes it’s GNOME.

Well, not really worried too much about security. The machine basically is just hooked up to a tv screen that displays a flash video. We removed the keyboard and mouse from the computer so we wouldn’t have to worry about anybody messing with it.

But occasionally the person who runs that department (who is very Anti-Technology!) will have to ssh and vnc into the machine and reboot it (made that very simple for them using PuTTY). So what I did was, I created a script that is launched at startup that runs in the background, and basically keeps polling the system every 10 seconds or so, grepping for this new user I created and if that user is logged in then it executes a “shutdown -r now”. Needed to make it as simple as possible for them and it seems to work good, so all they have to do is ssh in with their PuTTY launcher to that new user I created and it will reboot it for them.

Originally the machine had just the one “regular” user that it auto-logged into. But then when I created this other user for the purpose explained above, it had now asked to select a user and enter the password at the main login screen. So my goal is to make sure that nobody can accidentally login/select that user.

But I will definitely go back and apply the auto-login option.

Thanks,
Matt

All,

Does anyone know what “gdm-branding-upstreamThe GNOME 2.x Display Manager” Application does. I found it in YaST Software Manager by searching for “display manager”. I tried to install it but it says it will replace the one I already have, so I didn’t want to uninstall the one I have just in case it messes something up.

EDIT:
And I also saw “wdm — WINGs Display Manager” which in it’s description is says it has “a much more flexible login panel”. Is this something that would work with GNOME?

Thanks,
Matt