LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-27-2006, 06:04 PM   #1
theboss
LQ Newbie
 
Registered: Dec 2006
Distribution: Slackware 10.2
Posts: 15

Rep: Reputation: 0
run program as service with startup


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..

chkconfig annoyingly is not available on slackware

placing the script in rc.local runs it only on the first boot where as i want the service to run on every boot.

any helpful pointers in right directions..would appreciate...
 
Old 12-27-2006, 06:21 PM   #2
alunduil
Member
 
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Rep: Reputation: 62
Quote:
Originally Posted by theboss
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.

Regards,

Alunduil

Last edited by alunduil; 12-27-2006 at 06:23 PM.
 
Old 12-28-2006, 05:36 AM   #3
theboss
LQ Newbie
 
Registered: Dec 2006
Distribution: Slackware 10.2
Posts: 15

Original Poster
Rep: Reputation: 0
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..

Last edited by theboss; 12-28-2006 at 05:38 AM.
 
Old 12-28-2006, 05:44 AM   #4
theboss
LQ Newbie
 
Registered: Dec 2006
Distribution: Slackware 10.2
Posts: 15

Original Poster
Rep: Reputation: 0
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
 
Old 12-28-2006, 11:14 AM   #5
bsdunix
Senior Member
 
Registered: May 2006
Distribution: BeOS, BSD, Caldera, CTOS, Debian, LFS, Mac, Mandrake, Red Hat, Slackware, Solaris, SuSE
Posts: 1,761

Rep: Reputation: 80
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.
 
Old 12-29-2006, 12:02 AM   #6
Prostetnic_Jeltz
Member
 
Registered: Feb 2006
Posts: 66

Rep: Reputation: 16
Quote:
Originally Posted by theboss
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?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Run program a startup automatically shambler SUSE / openSUSE 2 09-13-2006 10:50 AM
Run program on startup thehendo Linux - Software 3 08-31-2006 05:07 AM
How to run httpd service automatically during startup jojojo Fedora 3 06-21-2006 04:21 AM
run program at startup.. me again.. :) rohan208 Linux - General 2 05-26-2004 08:03 PM
Startup service run by user other than root? WeNdeL Linux - Newbie 5 03-20-2003 02:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration