ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello everyone. I've been writing a server using Linux that has the capability to log information to a file. When I run the server in the foreground, this works properly. But when run in the background (through command & or a call to daemon()), nothing is logged. Logging to standard output works properly.
The app is written in C++ but is using C I/O (fprintf).
Is there something I'm missing regarding logging from a background process?
Thanks freegianghu. Is there any way to "daemonize" a simple script? In my case, it's actually a PHP script but running from the command line just like a Perl script.
Also, someone may find it helpful to note that I'm only experiencing this issue on my Debian box, my RH9 and CentOS 3.4 boxes run the script in the background just fine.
Originally posted by webvandals Thanks freegianghu. Is there any way to "daemonize" a simple script? In my case, it's actually a PHP script but running from the command line just like a Perl script.
Also, someone may find it helpful to note that I'm only experiencing this issue on my Debian box, my RH9 and CentOS 3.4 boxes run the script in the background just fine.
Thanks freegianghu. Is there any way to "daemonize" a simple script? In my case, it's actually a PHP script but running from the command line just like a Perl script.
Also, someone may find it helpful to note that I'm only experiencing this issue on my Debian box, my RH9 and CentOS 3.4 boxes run the script in the background just fine.
I have been searching around about back ground processing, but my application is embedded systems. I came across libslack (http://libslack.org/) which I haven't used but apparently this is a set of macros that you can use to create deamons() from simple c++/c programs.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.