Re: How to make a program automatically start at startup

From: Andrei Voropaev (avorop_at_mail.ru)
Date: 12/30/04


Date: 30 Dec 2004 08:00:07 GMT

On 2004-12-30, Gevadas A. Akkara <gevadas@yahoo.com> wrote:
> Hi
>
> I have made a c executable .I want this program to run automatically
> each time the system reboots.
>
> I tried by putting the program in /etc,/etc/init.d,rc.d ,rc0.d
> directories. Still the program is not starting automatically .
>
> I am using RedHat Linux.

Try putting it into /etc/init.d and then creating symlink to it from
rc3.d. Well, you may have to put it also into rc4.d, depends on which
run level you are boot in by default. The symlink should be named like
S42myprog. The important part is this 'S42'. '42' is an arbitrary number
that defines when your program shall be run.

Beware. Your program will receive single parameter 'start'. In general
it would be good that you read anything on SysV Init before fiddling
with it. Google it.

Also, quite possible, that it is enough to put your program into
.bash_profile in your home directory, and then it'll be run every time
when you login.



Relevant Pages

  • Re: word unexpectedly quits on Network user
    ... I had my Home Directory on another partition for years, ... created a symlink to a subfolder called "Applications" in my Home Directory. ... If i open a new blank document, it opens fine. ... then the word will quit unexpectedly. ...
    (microsoft.public.mac.office.word)
  • Re: no more /home after running sys-unconfig?
    ... > I notice that every time I do an upgrade, my home directory ... After the upgrade, ... Your symlink is not complaint with the automounter default. ...
    (comp.unix.solaris)
  • Re: mount in userfolder?
    ... directory is copied over to the new home directory, ... symlinks in it (a symlink is basically a text file with a destination ... Just keep in mind that things work differently in Linux, ... Technically you could add a forced symlink command to the /etc/profile ...
    (alt.os.linux)
  • Re: determine when user account created?
    ... > I agree that UFS does not easily provide creation time, ... > do know that the symlink in the user's home directory was created within a ... Why do you expect a symlink from ... purposes -- .bash_profile is only for the login shell, ...
    (comp.unix.solaris)
  • Re: determine when user account created?
    ... > I agree that UFS does not easily provide creation time, ... > do know that the symlink in the user's home directory was created within a ... Why do you expect a symlink from ... purposes -- .bash_profile is only for the login shell, ...
    (comp.sys.sun.admin)