SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
i'd assume there's a better solution to actually do what you want, but to do literally what you're asking, you'd add a line to /etc/rc.local
as for logging on, well that can be a little messy.. what does "log-in" mean? sounds daft, but every time you open a new terminal window in X, you're essentially logging on again... you can so this by adding commands to ~/.bashrc per user, but i don't think this is really what you're after
Distribution: Lots of distros in the past, now Linux Mint
The ridiculously easy way is simply to take that line, preface it with a line above it invoking bash, then drop it into your start scripts directory (varies with distribution)
For instance, the script would be (and this most likely remains true on all distros):
ip route add 'ipaddress'/24 'gateway'
create the file with your favorite editor, then navigate to /etc, and look for something along the lines of rc#.d (or a variation like rc.5, etc.), and copy the file there with the prefix S## (bigger numbers are better, as they start later, allowing more important processes to start first, though you might need a smaller number so it starts before a process that needs it up and running) (as the root user, obviously). use chmod to make sure it's readable/executable ('man chmod' on the command line can guide you), and reboot to test, or start the file manually (/etc/rc'directory'/name of your file.
Sounds complicated, but you can get the idea by looking at the relevant /etc/rc... files and directories and taking your cues from them. Don't be too worried about some of the items in the files themselves, as they are simply shell scripts to ensure that the programs don't start multiple copies or restart if they fail (you can add these things later, but for now they are redundant, as you can manually do the same if you must, and they don't typically fail in this manner).
Thanks guys - perfect. Seems that I learn at least 5 new useful procedures with every thread I read round here.
As for what I meant by 'log-in', sorry about that i'm still with 'windows speak' for the time being. I was refering to starting a session in X. Say if I logged in as 'TKD' i want gaim to auto-launch - whereas i'd want different apps to launch if i logged in as root.
Should I be looking at .xinitrc for this?
well no you wouldn't, again depends what you're logging in to... gnome and KDE will autosave sessions is you want them to, so that's done at a totally hands-off patronizng gui level afaik, .xinitrc is only used when you load X from a console, not when you log into X through a grpahical login maanger. there is ~/.Xsession though.