SlackwareThis Forum is for the discussion of Slackware Linux.
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.
following suggestion of a board member here..i have suscessfully created the rc. script for starting my application as service at boot..
Now according to google search..i am supposed to place that script in rc.d directory and then run chkconfig..
Slackware requires a bit more hacking than the RH distributions, and requires you to create the rc script, and then add that script call from either rc.local or to the run-levels you want it in. Of course, don't forget to chmod 755 rc.<script>.
Quote:
Originally Posted by theboss
placing the script in rc.local runs it only on the first boot where as i want the service to run on every boot.
Just for your information rc.local runs every time the machine starts, and this is the same procedure for all of the other startup scripts as well.
well if i do a proper shut down or reboot either via the shutdown utlity or ctrl+alt+del then it works fine
However upon an improper shutdown like power failure or hitting the reset swicth..the service doesnt start....that is quite the incovience because i have built a web cache which will be running 24/7 .but in case a power faiure may occur..it should start automatically..
Distribution: BeOS, BSD, Caldera, CTOS, Debian, LFS, Mac, Mandrake, Red Hat, Slackware, Solaris, SuSE
Posts: 1,761
Rep:
Quote:
... do i have to give the start prefix ...
That depends on how the script is written. If you know how to read scripts, then you would know. Did the script come with documentation about how to run the script? Try the script from a command line without the 'start' prefix and see what happens.
Code:
# /etc/rc.d/rc.someapp
If the script needs the 'start' prefix, then you should get a usage error. 'start', 'stop', and 'restart' are functions that can be written into scripts, but not all scripts use them. It all depends on how the script developer/writer wrote the script.
after giving the path of the rc. script in rc.local do i have to give the start prefix like
/etc/rc.d/rc.someapp start
or just add the line in rc.local without affixing the start parameter
the arguments are specified using "case" in shell scripts - take a look at a simple script that uses it to see how it works, like /etc/rc.d/rc.samba for example. it's rather simple, you can add it in your script if you want. also check the bash man page, and there are a ton of tutorials on writing scripts online.
not sure why listing the script in rc.local isn't working, but rc.local is called by rc.M, which is in turn called by /etc/inittab at startup in multiuser runlevels... maybe there is a lock or something that needs to be cleared if the app is shutdown improperly? if so, you could check for that in your script?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.