Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm ruinning a program called freepops...What I want is for it to start whenever I log into my account...How would I do this? A shell script? If so, how do I write said script? All I need to do is run the command freepopsd -p2001 However, it must be run as root, even when I login as a different user. ANy help would be apperciated!
Put the command you need to run in a script, and copy the script into /etc/init.d. Make it executable by doing (as root):
chmod +x /etc/init.d/yourscript
I believe the first line of the script needs to be:
for it to work this way. Anything in the /etc/init.d folder is executed when your computer boots up (I'm not sure if SuSE uses a different location; it might be /etc/rcS or something similar); you can run it manually just by typing /etc/init.d/yourscript from a root console.
the program needs to run as root to start properly--will this method do this? actually, i wasn't able to get the script to work:
ws116159:~ # /etc/init.d/freepopsstartup
bash: /etc/init.d/freepopsstartup: /sbin/runscript: bad interpreter: No such file or directory
Do you have an /sbin/runscript binary? The shebang (#!) is followed by the name of the interpreted to run the script, e.g. #!/bin/bash for a bash script. To make the program run as root, you'll need to set it SUID root, but the kernel will not honor the SUID bit on shell scripts. If it's in Perl you could use suidperl, otherwise you'll have to write a wrapper for it (this is a simple task), but I need to ask, what do you need to run as root at login time (as opposed to boot time or periodically). if you tell us what you're trying to do, maybe someone can suggest a better way to do it.
I saw on sourceforge.net (at least i think so) that there was a program that converts shell scripts to C code in which you then compile the C code to make an executable. Darn, forgot what it was called. I'll try looking for it...
actually, i'm trying to run it at boot time--i figured that would be the best. What I'm trying to run is a program called freepops. It checks various webmail services (gamil, aolmail, yahoo, etc) and turns it into POP3 so a normal email program can read it. I need it to start at boot time, as root, and I have to apss it certain paremeters (i.e. -p2001)
Thanks for any help!
apparently, and i quote:
n posix environments like Debian GNU/Linux you can start FreePOPs at boot time as a standard service. In this case the command line switches are stored in /etc/default/freepops, in some rpm based systems you should find the same file as /etc/sysconfig/freepops.
What does this mean? What is a standard service and how do I set it to start??? I think I understand the command line switches, though--I would jsut add my parameters to that file?
The startup scripts for services are stored in /etc/init.d or /etc/rc.d/init.d depending ondistro -- you can you chkconfig to activate a script to run at a particular runlevel (Debian uses runlevel 2 for multiuser mode, and many distros like SuSE use runlevel 3). If you don't want to mess with the runlevel scripts, you can just add the command to your rc.local (usually /etc/rc.local but SuSE might put it somewhere else).