All Forums |
Register |
Login |
Search |
Subscriptions |
My Profile |
Inbox |
Tool Warehouse |
FAQs |
Resources |
Help |
Member List |
Address Book |
Logout |
|
|
Using service or rc2.d script
|
Logged in as: Guest |
Users viewing this topic: none |
|
Login |
|
|
Using service or rc2.d script - Apr. 20, '06, 10:46:36 AM
|
|
|
gzfh4t
Posts: 5
Joined: Dec. 1, '05,
Status: offline
|
I am trying to start a daemon at boot time which accesses a network folder via the /net directory. Using the traditional rc2.d directory doesn't appear to work as the daemon is run with localadmin privileges at boot time, and localadmin doesn't have access to the network folder. If I log on and manually run the script as domain admin, then everything is fine.
I have attempted to use the "service" utility, to register the script as a service which should run as the domain administrator. The registration seems to have worked fine, but whenever I attempt to start the service, I get the following message:
"There was an error connecting to the subsystem. The error status code was 0x00000000 while trying to launch program C:\SFU\etc\init.d\myscript."
Am I missing something.
Any help would be much appreciated.
Cheers,
Mat
|
|
|
RE: Using service or rc2.d script - Apr. 20, '06, 12:30:33 PM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
A daemon should be a binary, not a shell script.
If you want to run a script then specify "/bin/sh" as the binary with
the script's path as the arg ("/bin/sh -c path").
|
|
|
RE: Using service or rc2.d script - Apr. 22, '06, 4:19:50 PM
|
|
|
gzfh4t
Posts: 5
Joined: Dec. 1, '05,
Status: offline
|
Rodney,
Thanks for that. That has worked, sort of. I can now register and run the "service", although Windows thinks the service has failed, as it has exited ( the shell I imagine), but my daemons now start up at boot time and can access network drives.
Thanks,
MAt
|
|
|
RE: Using service or rc2.d script - Apr. 22, '06, 5:24:16 PM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
Win32 services are not expected to be daemons. That is Win32 expects the
original process will hang around forever unless it is stopped or has
crashed. The original process in this case will be the sh. If
you want to stop the message (which is harmless BTW) then just have the
script wait at the end forever. If you want to get fancy while sh
is hanging out, you can have it pass the TERM signal on to the daemon.
A stop from the Win32 service manager gets translated to signal TERM.
|
|
|
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 |
|
|
|