Thread: Writing a linux (centos 4) c++ daemon that interacts with PHP

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    11

    Writing a linux (centos 4) c++ daemon that interacts with PHP

    Ok, first of all I'm not really new here, I used to post here a while back. my name seems to be gone or password is set to something crazy or something I gave up trying to get my password.

    Anyways I have a PHP project I've been working on. It's a series of classes much like gsQuery if any one has heard of it. Its to query game servers and stuff. But I'm making mine to use as a control panel for game servers.

    All of my servers will be a pure CentOS 4.4 (or whatever the latest update is at the time) network. I've finished doing much of the PHP part as far as querying servers. Now i need to implement the big parts. Which is the ability to install game servers, update game servers, apply server plugins/mods/anything of that nature.

    Since the user front end is PHP/MySQL based I need to create a server side daemon that will be used to run the different server installation applications blah blah blah, and (I guess it makes most sense to update a database as it progresses). Some things like installing a game server could take hours to do.

    I think it would be best to do it with C++, even though I don't have the best c++ background I am experienced enough in the field in general where I could do this if someone was able to get me started on the right foot.

    On google I was able to find this: http://www.linuxprofilm.com/articles...mon-howto.html

    and that's really it. I've tried all sorts of search terms but that was what I could find. It looks fairly in depth and provides me with the basics of creating a daemon. Of course I'm sure theres much more to know than that (given my specific needs)

    Any help would be greatly appreciated, thanks.

  2. #2
    Registered User
    Join Date
    Jan 2007
    Posts
    11
    Someone in another forum mentioned it may not be a bad idea to use java for the daemon instead. (since apparently its good at threading)

    Also there is the possibility in the future to create a java (or c++, probably java since its cross-platform) desktop version of what im making so people can access their game servers from a desktop application instead of logging into the website.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    I think I'd do it in Python. Good balance between shellscript-like features that make it useful for installing, starting and stopping other applications, and proper programming language that lets you write daemon-like stuff.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    Registered User
    Join Date
    Jan 2007
    Posts
    11
    Quote Originally Posted by CornedBee
    I think I'd do it in Python. Good balance between shellscript-like features that make it useful for installing, starting and stopping other applications, and proper programming language that lets you write daemon-like stuff.
    on google i found this

    http://homepage.hispeed.ch/py430/python/daemon

    which seems to be a skeleton for something of this nature.
    I have light experience with python (which I have no problem getting into more, as it seems writing in python is also somewhat more "relaxed" than c++). But i have no experience in writing daemons, but i understand the basic principles of what it's supposed to do and how it operates

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linux Linux why Linux??
    By afreedboy in forum Tech Board
    Replies: 146
    Last Post: 01-21-2004, 06:27 PM
  2. linux daemon design
    By rotis23 in forum C Programming
    Replies: 8
    Last Post: 09-13-2002, 08:48 AM
  3. PHP and Apache On Linux
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 05-07-2002, 12:10 PM
  4. Writing Linux Drivers
    By Jperensky in forum Linux Programming
    Replies: 1
    Last Post: 03-20-2002, 09:30 AM