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!
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.
Hello,
I want to run an executable c file on start up. Im using ubuntu. I read few how to on this topic, but things are not working so far. These are the steps i followed:
1. create myscript.sh in etc\init.d
myscript.sh
#run c file
./start
2. give the file permissions:
chmod +x myscript.sh
3. create a symbolic link in rc3.d:
sudo ln -s /etc/init.d/myscript.sh /etc/rc3.d/S500myscript.sh
sudo ln -s /etc/init.d/myscript.sh /etc/rc3.d/K001myscript.sh
Currently I am in runlevel 2, I switch to runlevel 3 by the following comman:
sudo init 3
I expect my c code to run..but this is not the case
I also tried this command:
sudo update-rc.d myscript.sh defaults
what about manually start your c file
#/etc/init.d/myscript.sh start, is this successfully start your c file? if yes check below mention things
did u check whether the startup script added on runlevel 3
#chkconfig --list | grep myscript.sh
or
#cd /etc/rc3.d, and check whether the script is exist or not
what about manually start your c file
#/etc/init.d/myscript.sh start, is this successfully start your c file? if yes check below mention things
did u check whether the startup script added on runlevel 3
#chkconfig --list | grep myscript.sh
or
#cd /etc/rc3.d, and check whether the script is exist or not
maually starting myscript.sh works
I cd to /etc/rc3.d and the soft link is there named S99MAS
I have a similar problem - I want to automatically start and stop Apache HTTP Server on Linpus.
I've added a script to /etc/init.d.
I've run chkconfig to add the service.
I've checked that the script exists in /etc/rc5.d (I'm assuming this is the relevant run level - executing runlevel just gives me "unknown" for some reason..?)
I can start and stop the service using:
service apache start
service apache stop
But when I reboot, the script doesn't run. Where do I go from here?
Thanks,
Bernie
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.