How do I execute CGI script on startup on Apache/1.3.1 Cobalt

How do I execute CGI script on startup on Apache/1.3.1 Cobalt

Post by kellykros » Tue, 20 Apr 1999 04:00:00



have a site that runs on a Apache/1.3.1 Cobalt (Unix) server. I would
like to know if it is possible to have a CGI script execute on startup
and remain present. I share space on this server. The site Admin isnt
the
helpful type if possible I would like to enable this myself. Ive tried
to
execute the program from browser and telnet command line but it appears
to
terminate when exiting or logging off. P.S The script is designed to
continuously
monitor files in a directory.

Thanks in advance for any help.
Kelly Kross

 
 
 

How do I execute CGI script on startup on Apache/1.3.1 Cobalt

Post by J.D. Silvest » Tue, 20 Apr 1999 04:00:00



: have a site that runs on a Apache/1.3.1 Cobalt (Unix) server. I would
: like to know if it is possible to have a CGI script execute on startup
: and remain present. I share space on this server. The site Admin isnt
: the
: helpful type if possible I would like to enable this myself. Ive tried
: to
: execute the program from browser and telnet command line but it appears
: to
: terminate when exiting or logging off. P.S The script is designed to
: continuously
: monitor files in a directory.

As a user you could start your script from the command line using
"nohup".  Do a "man nohup", without the quotes, on the servers command
line.  The syntax for nohup should be something like:
        nohup your_command
where your_command is the script you want to execute.  This will allow
your script to function without hangups (well, your script will
terminate should your System Admin. kill the process or shutdown the
machine).  However (this is IMPORTANT), Systems Administrators tend
not to like it when users run commands that are going to sit in memory
eating up processing cycles.  You may want to re-visit this with your
Administrator.  The person might come across as not being helpful when
really she/he is just trying to stop you from doing something that
could affect the system's processing.  You say your script is designed
to "continuously" monitor files in a directory.  Does your script check
the status of the directory, go to sleep for a period of time, then
re-check the status of the directory?  Or does it actually continually
check the status of the directory?  If it is the latter, you may want
to re-design your script.  Your Administrator might be more receptive
if you could tell her/him "Well, it checks the directory, sleeps for
(insert your time increment here) then re-checks the directory, then
sleeps again...."

John

 
 
 

How do I execute CGI script on startup on Apache/1.3.1 Cobalt

Post by Dan Chiasso » Tue, 20 Apr 1999 04:00:00


What do you mean by startup? Do you mean when the server boots up? If so,
you'll probably need root privileges to modify /etc/rc.d/init.d and add a
startup script there.

If that's not possible, an easier way is to run your script on a cron job,
making the appropriate changes to your script so it exits after each time it
runs, instead making it sleep() and wait.  You should have access to a
crontab file associated with your shell account.

If you've never used a cron schedule, try this:
Through telnet, try the command "crontab -e". It should open a text editor
with a somewhat blank crontab file. In that file you can schedule your
script to run as often as you wish, to the nearest minute. Check you man
pages for a UNIX reference for the proper syntax.

I'm not sure this answers you question, but I hope it helps!
Dan Chiasson

----------


Quote:>have a site that runs on a Apache/1.3.1 Cobalt (Unix) server. I would
>like to know if it is possible to have a CGI script execute on startup
>and remain present. I share space on this server. The site Admin isnt
>the
>helpful type if possible I would like to enable this myself. Ive tried
>to
>execute the program from browser and telnet command line but it appears
>to
>terminate when exiting or logging off. P.S The script is designed to
>continuously
>monitor files in a directory.

>Thanks in advance for any help.
>Kelly Kross

 
 
 

1. Need CGI script execute on startup

 have a site that runs on a Apache/1.3.1 Cobalt (Unix) server. I would
like to know if it is possible to have a CGI script execute on startup
and
remain present. I share space on this server. The site Admin isnt the
helpful
type if possible I would like to enable this myself. Ive tried to
execute
the program from browser and telnet command line but it appears to
terminate
when exiting or logging off. P.S The script is designed to continuously
monitor files in a directory.

Thanks in advance for any help.
Kelly Kross

2. LIST SERV WANTED

3. How do i CGI script execute on startup

4. Iomega Zoom SCSI Aaapter

5. How can I get a CGI script to auto execute under Apache 1.1.1

6. slakware and shadow problem

7. apache suexec not executing ~user/script.cgi

8. Question about libraries

9. Apache executing cgi-scripts inside .htaccess protected directories

10. Apache error when executing cgi-scripts

11. pls help re: executing cgi scripts in html & apache conf.

12. apache ??:allowing users to execute their cgi scripts

13. could not execute cgi script on Apache