run program at start up
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > run program at start up




Pages (2): [1] 2 »   Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    run program at start up  
Jimmie


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-20-04 10:50 PM

Hi,
So I created a program called foo, and i want to run foo when linux
starts up, how do i go about doing this? Im using slackware.

Jimmie Barnett





[ Post a follow-up to this message ]



    Re: run program at start up  
Fletcher Glenn


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-21-04 01:47 AM



Jimmie wrote:
> Hi,
> So I created a program called foo, and i want to run foo when linux
> starts up, how do i go about doing this? Im using slackware.
>
> Jimmie Barnett

You need to make an entry in one of the /etc/rc?.d directories where ?
is a single digit integer.

--

Fletcher Glenn






[ Post a follow-up to this message ]



    Re: run program at start up  
Jim Cochrane


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-21-04 01:47 AM

In article <cf6cc6cc.0410201546.ff4501@posting.google.com>, Jimmie wrote:
> Hi,
> So I created a program called foo, and i want to run foo when linux
> starts up, how do i go about doing this? Im using slackware.
>
> Jimmie Barnett

One common method - read up on /etc/init.d and /etc/rc.d, directories that
hold scripts that are run on start-up.

--
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line
 to
get through my spam filter.]





[ Post a follow-up to this message ]



    Re: run program at start up  
Jem Berkes


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-21-04 01:47 AM

> So I created a program called foo, and i want to run foo when linux
> starts up, how do i go about doing this? Im using slackware.

Very easy with slackware, just insert the command into
/etc/rc.d/rc.local

Make sure full paths are specified to everything.

--
Jem Berkes
http://www.sysdesign.ca/





[ Post a follow-up to this message ]



    Re: run program at start up  
Jim Cochrane


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-21-04 01:47 AM

In article <Xns9588C907C52A3jbuserspc9org@130.179.16.24>, Jem Berkes wrote: 
>
> Very easy with slackware, just insert the command into
> /etc/rc.d/rc.local

Except if the command is a binary executable, in which case you'll need to
write a script to run the command and put the script into .../rc.local
.

--
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line
 to
get through my spam filter.]





[ Post a follow-up to this message ]



    Re: run program at start up  
Jem Berkes


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-21-04 01:47 AM

>>> So I created a program called foo, and i want to run foo when linux 
>
> Except if the command is a binary executable, in which case you'll
> need to write a script to run the command and put the script into
> .../rc.local .

Why do you say that? rc.local itself is a shell script (you'll see
#!/bin/sh at the top). You can run other shell scripts or binaries directly
out of there.

--
Jem Berkes
http://www.sysdesign.ca/





[ Post a follow-up to this message ]



    Re: run program at start up  
Jim Cochrane


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-21-04 01:47 AM

In article <Xns9588CDA727A5jbuserspc9org@130.179.16.24>, Jem Berkes wrote: 
>
> Why do you say that? rc.local itself is a shell script (you'll see
> #!/bin/sh at the top). You can run other shell scripts or binaries directl
y
> out of there.
>

Oops, I was thinking about the /etc/rc?.d directories and forgot that
rc.local is a script, not a directory.  Of course, one can start up a
binary executable by inserting instructions into rc.local to start it up.
I meant that one cannot put a binary into, e.g., /etc/rc4.d/ as a means to
have it started automatically.  Instead, a script must be used to start it
up - either rc.local or a fresh script that gets placed into the
appropriate /etc/rc?.d directories.

Sorry about the confusion.

--
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line
 to
get through my spam filter.]





[ Post a follow-up to this message ]



    Re: run program at start up  
Lew Pitcher


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-21-04 07:47 AM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fletcher Glenn wrote:
>
>
> Jimmie wrote:
> 
>
>
> You need to make an entry in one of the /etc/rc?.d directories where ?
> is a single digit integer.

Sorry, but slackware doesn't have /etc/rc?.d directories. It has one directo
ry
called /etc/rc.d, and scripts in that directory. The scripts are called
rc.0, rc.M, rc.gpm, rc.keymap, rc.netdevice, etc.

To the OP, add your program to the /etc/rc.d/rc.local script

- --
Lew Pitcher

Master Codewright & JOAT-in-training | GPG public key available on request
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBdx/JagVFX4UWr64RAjxQAJ9AsI/tQAkPKfa24eHHwISEGx/E+wCfZPSz
wn9pCduo2wrtmN/NA9IuF4Y=
=QK+q
-----END PGP SIGNATURE-----





[ Post a follow-up to this message ]



    Re: run program at start up  
Heiko


Report This Message To A Moderator Edit/Delete Message


 
10-21-04 12:48 PM

Jim Cochrane wrote:

> I meant that one cannot put a binary into, e.g., /etc/rc4.d/ as a means to
> have it started automatically.  Instead, a script must be used to start it
> up - either rc.local or a fresh script that gets placed into the
> appropriate /etc/rc?.d directories.

The OP uses slackware, which uses BSD-style init. This means /etc/rc?.d
directories are not used, nor present on a slackware system.

Heiko





[ Post a follow-up to this message ]



    Re: run program at start up  
Jim Cochrane


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-21-04 10:56 PM

In article <41779eb9$0$568$e4fe514c@news.xs4all.nl>, Heiko wrote:
> Jim Cochrane wrote:
> 
>
> The OP uses slackware, which uses BSD-style init. This means /etc/rc?.d
> directories are not used, nor present on a slackware system.
>
> 	Heiko

Thanks for the correction.

Does that mean that the only way on a Slackware system to have init
start a process when the system starts up is to modify rc.local to do it?

--
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line
 to
get through my spam filter.]





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:44 PM.      Post New Thread    Post A Reply      
Pages (2): [1] 2 »   Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register