Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi to all ,
i need to write a script that will run everytime my system reboot.
i have few commands that i need them to be executed when the server boot up
If it's some type of daemon, this depends on what distribution you're using. Most reside in /etc/init.d or /etc/rc.d
If it's just a few commands that don't run as a service or the like, simply place the script or commands in your rc.local file to get invoked at bootup.
If it's some type of daemon, this depends on what distribution you're using. Most reside in /etc/init.d or /etc/rc.d
If it's just a few commands that don't run as a service or the like, simply place the script or commands in your rc.local file to get invoked at bootup.
iam Using Fedora 8 .
so it must be init , and about the deamon , well maybe keep it last so al services are running .
commands are ,
1 - ssh: to a remote server.
2 - mail: as an alert.
3 - iptables: for routing .
1 - ssh: to a remote server.
2 - mail: as an alert.
3 - iptables: for routing .
These would be good candidates for rc.local, not their own customized init startup script to me. Why would you need to ssh into a remote server out of curiosity that is in a startup script?
These would be good candidates for rc.local, not their own customized init startup script to me. Why would you need to ssh into a remote server out of curiosity that is in a startup script?
well, too keep things short , iam using ssh to access the web. since my ISP blocks most sites.
with this command :
ssh -D 8998 username@remoteserver.com
which i have set up on my browser settings as well ,
well, too keep things short , iam using ssh to access the web. since my ISP blocks most sites.
with this command :
ssh -D 8998 username@remoteserver.com
which i have set up on my browser settings as well ,
well, guys i tried to put the SSH command in the rc.local , when the system boots up , it logs to the remote server and jams after i cant login to the system anymore . had to boot into level 3 to exit the SSH connection .. any ideas ?????
Note that your privatekey cannot require a passphrase if you do this.
I haven't actually tested that this works with an init script. It's possible that you might need to add nohup in front of ssh.
sorry my dear friend . but what is a nohup ???
and when i added the ssh to the rc.local i could see it connected to the server , but the problem is that i cant be a local user anymore unless i exit ???
is there a way to keep it running in the background ???
and when i added the ssh to the rc.local i could see it connected to the server , but the problem is that i cant be a local user anymore unless i exit ???
is there a way to keep it running in the background ???
hi , i tried , nohup , and "-n" and "-s" ,,, still no use ??
oh, and nohup means that the command will run immune to 'hangups'. it won't be attached to the shell script from which it was launched so the script should be able to exit. (often, shells wont exit completely if there are attached processes still running).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.