IndiFTPD service

This is a discussion on IndiFTPD service within the Windows Programming forums, part of the Platform Specific Boards category; Hi! For about 1/2 year ago I needed a open source server, that was easy to fix for my needs. ...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    12

    IndiFTPD service

    Hi!
    For about 1/2 year ago I needed a open source server, that was easy to fix for my needs. I did some googling and ended up with IndiFTPD. I changed the source code a bit to fit my needs.

    This ftp server is just an exe and a config file, so I just run the exe and the server is up. This has worked nice for 1/2 year now. But the problem is that if I am not around and something happens, the ftp server goes down (like a power break).

    So I was planning to make it run as a service, this way if something happens its just to boot/reboot my pc.

    In the source code there is a built in service.cpp and service.h. So I thought it should be easy to make it run as a service. I added my exe as a service and try to start it. Then I get this:

    "Error 1053: The service did not respond to the start or control request in a timely fashion"

    I read around a bit and finds out this about the class:
    CService [Service.cpp/Service.h]:
    This class contains methods to setup an application to run as a service
    -- not used in IndiFTPD. Currently this is mostly useful for Windows.
    And here is my problem, I can’t get it to work, I have studied the code, searched google, and I can’t find out how to set up IndiFTPD as a service. I am sure this is easy for an experienced coder to figure out? (Atleast i hope so)

    I don’t want to change ftpd since I have a user database on 100+ users.

    Sourcecode can be found here: http://www.dftpd.com/indiftpd-source.php

    I hope somebody can help me.

  2. #2
    Registered User
    Join Date
    Oct 2005
    Posts
    12
    Wierd that nobody know it, i thougth it would be easy since there already is a service.cpp and a service.h

    Only problem is that the class aint used correct way(since it dont respond when its added as a serivce)

  3. #3
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059
    The Service Control Manager (SCM) has to be notified of the status of the service on a regular basis. If not, the SCM terminates the service. Thus, you have to call SetServiceStatus more often throughout your code. Especially before and during an extended processing cycle. Otherwise, you will get the 1053 error.

  4. #4
    Registered User
    Join Date
    Oct 2005
    Posts
    12
    thnx for the reply

    I have already fixed the problem now, since nobody could answer me, i just wrote a new service part in the code i searched the forum and got some nice toturials. Its running nice as a service now, just some minor bugs when reading the config file, im sure ill figure it out myself when i got time to check it out if not ill ask here:P hehe :-)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. running my program as service
    By daher in forum Windows Programming
    Replies: 5
    Last Post: 09-05-2008, 12:30 PM
  2. Windows service status checking
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 06-01-2008, 08:19 AM
  3. eek a virus
    By MisterSako in forum Tech Board
    Replies: 17
    Last Post: 06-08-2005, 03:29 PM
  4. Replies: 1
    Last Post: 06-03-2005, 01:03 AM
  5. Another windows service question... starting/stopping
    By BrianK in forum Windows Programming
    Replies: 1
    Last Post: 03-19-2003, 11:22 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21