473,413 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

how do you return an exit code with out exiting

I wrote a simple python program that scrapes a web page every 30 secons
and dumps the result in a data base. I want to use my linux distros
build in init tools to run the script in the back ground as a daemon.
The problem is when I call the daemon script to background the program I
wrote it just hangs, waiting for my program to exit 1 or 0. My program
never does exits because its looping every 30 seconds.

Is there a way I can pass an exit value with out actualy exiting? or is
there are better way to do this?

Thanks
--
Matthew Thorley
Jul 19 '05 #1
2 1390
On 2005-05-23, Matthew Thorley <ru***@chpc.utah.edu> wrote:
I wrote a simple python program that scrapes a web page every
30 secons and dumps the result in a data base. I want to use
my linux distros build in init tools to run the script in the
back ground as a daemon. The problem is when I call the daemon
script to background the program I wrote it just hangs,
waiting for my program to exit 1 or 0. My program never does
exits because its looping every 30 seconds.

Is there a way I can pass an exit value with out actualy exiting?
No.
or is there are better way to do this?


Yes.

To be a well-behavied daemon, you need to do the things
described in this howto:

http://www.linuxprofilm.com/articles...mon-howto.html

Here are a couple references on how to do this in Python:

http://aspn.activestate.com/ASPN/Coo.../Recipe/278731
http://homepage.hispeed.ch/py430/python/

--
Grant Edwards grante Yow! Intra-mural sports
at results are filtering
visi.com through th' plumbing...
Jul 19 '05 #2
thanks thats perfect!

Grant Edwards wrote:
On 2005-05-23, Matthew Thorley <ru***@chpc.utah.edu> wrote:

I wrote a simple python program that scrapes a web page every
30 secons and dumps the result in a data base. I want to use
my linux distros build in init tools to run the script in the
back ground as a daemon. The problem is when I call the daemon
script to background the program I wrote it just hangs,
waiting for my program to exit 1 or 0. My program never does
exits because its looping every 30 seconds.

Is there a way I can pass an exit value with out actualy exiting?

No.

or is there are better way to do this?

Yes.

To be a well-behavied daemon, you need to do the things
described in this howto:

http://www.linuxprofilm.com/articles...mon-howto.html

Here are a couple references on how to do this in Python:

http://aspn.activestate.com/ASPN/Coo.../Recipe/278731
http://homepage.hispeed.ch/py430/python/

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rigga | last post by:
Hi, I am new to Python and am currentky just playing with some simple functions however I can not work out how to return a variable back from a module, probably easier if you see the code.. what...
6
by: RitaG | last post by:
Hi. I have a Sub that calls a Boolean Function and exits the Sub if the Return value is False. The problem is it's exiting the Sub even if the Return value is True. Here's my code. Private...
2
by: Von Bailey | last post by:
I need a way to disable the Return/Enter key in specific fields or on a given form. The goal is to limit way the user exits field as there is necessary code run when the user exits the field and...
2
by: steve bull | last post by:
I have built what I think should be a dialog box. It contains 4 tabbed panes for generating a range of colors. Each tabbed pane consists of a panel with all the widgets on them including the OK and...
0
by: Cwappy | last post by:
I have a class that builds a DataTable and then, when the process is exiting, tries to write that DataTable to SQL Server 2000 via the SqlBulkCopy class. I know the process is exiting because I'm...
4
by: amatoo04 | last post by:
hi guys, i am trying to finish up a program i started this morning and basically i got the whole input and output down... i just need help with the function which will scan the file and return number...
2
by: Matuag | last post by:
Hi All, I want to create following command buttons on a Form which users can edit. Save ( Save Changes made) Cancel ( Undo data changes) Exit ( Close form) I am using Macros for each of...
4
by: devi thapa | last post by:
Hi, I am executing a python script in a shell script. The python script actually returns a value. So, can I get the return value in a shell script? If yes, then help me out. Regards, Devi
2
by: Bassem | last post by:
I'm working on simple chat program via serial port. It works fine, but i face this problem. When i try to open the exe, UnauthorizedAccess exception occurs, i can't use COM1 becuase someone else has...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.