LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-10-2005, 11:16 AM   #1
csfalcon
Member
 
Registered: Jun 2004
Location: MD
Distribution: Fedora Core
Posts: 269

Rep: Reputation: 31
calling system command in daemon


Hi all,

I wrote some function to monitor some process using popen("ps -e | grep ...") and if no output is there, I try to start the process with system("...").
The function I wrote works as an program, but when I start it as a daemon, it stops working. Anyone knows the reason why? thanks in adance.
 
Old 05-10-2005, 01:17 PM   #2
LogicG8
Member
 
Registered: Jun 2003
Location: Long Island, NY
Distribution: Gentoo Unstable (what a misnomer)
Posts: 380

Rep: Reputation: 30
Well depending on how you implemented your program you may have closed std{in,out,err}
(Possibly opened /dev/null instead) and that could be a problem for you. How about posting the
code, and a more complete definition of "working".
 
Old 05-13-2005, 11:17 AM   #3
csfalcon
Member
 
Registered: Jun 2004
Location: MD
Distribution: Fedora Core
Posts: 269

Original Poster
Rep: Reputation: 31
It turns out the problem was not with my daemon, but the program I was trying to start. Thanks for helping.

For anyone who's interested, here is how I created the daemon:
http://www.csfalcon.com/index.jsp?topic=UNIX%20Daemon
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
calling a system function directly from C program appas Programming 8 08-03-2004 01:50 AM
C++ calling linux command grabbing output wilso027 Programming 7 04-23-2004 07:19 AM
calling command line functions in java darthczyz Programming 2 12-09-2003 07:01 AM
System shutdown when calling SETUP. Tobbe Slackware 6 06-26-2003 11:03 PM
C program code calling a Linux system command Linh Programming 1 06-05-2003 01:44 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration