All Forums |
Register |
Login |
Search |
Subscriptions |
My Profile |
Inbox |
Tool Warehouse |
FAQs |
Resources |
Help |
Member List |
Address Book |
Logout |
|
|
Can not run daemon script from winodws prompt
|
Logged in as: Guest |
Users viewing this topic: none |
|
Login |
|
|
Can not run daemon script from winodws prompt - May 13, '06, 10:19:20 AM
|
|
|
shailishi
Posts: 15
Joined: Jan. 6, '06,
Status: offline
|
I have an script that i am running as daemon by init script. (i have written a c program to make it as daemon). I am able to run this script as daemon through shell by calling init script, but it does not work if i am invoking from window prompt e.g.
C:\WINDOWS\posix.exe /u /c /bin/csh -l -c "/etc/init.d/test start" fails to start daemon script
In test init script i am invoking the daemon c prog to run the script as daemon.
is thre any diffrence in invoking the command in shell and invoking command on windows prompt as above.
Thanks
|
|
|
RE: Can not run daemon script from winodws prompt - May 14, '06, 3:12:06 AM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
It's likely something in your script.
Do you get an error message?
What is your script?
|
|
|
RE: Can not run daemon script from winodws prompt - May 14, '06, 7:25:22 AM
|
|
|
shailishi
Posts: 15
Joined: Jan. 6, '06,
Status: offline
|
I am not getting any error message and script works fine if i am invoking it on shell prompt.
This script is used to monitor a windows service and threfore uses wrapper for SC windows utility to check status of service.
In the c daemon function however i am using execl("bin/sh","sh","-c", "/etc/init.d/checkservice.sh");
and my init script /etc/init.d/test calls daemon function to run the checkservice.sh script as daemon.
Thanks
|
|
|
RE: Can not run daemon script from winodws prompt - May 14, '06, 11:44:31 PM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
Your script is likely running fine in a shell because the shell is being
displayed within a "console window". The stdin/stdout of a Win32 program
just can't handle some things very well. It's a weakness of many Win32 programs.
So often you need to direct the stdin and/or stdout with a file (typically /dev/null).
Something like "win32prog < /dev/null > /tmp/foo ; cat /tmp/foo".
This is only an example, pipes can often be used as an alternative coupled with cat32.
You might also be interested in using Interix's service utility instead.
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
|
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|
|