Windows service porting to linux

Windows service porting to linux

I am porting an application which runs as a background service in windows at startup, we are porting the application to linux(SUSE Enterprise server), I'am completely new to linux. Can somebody help me on how to proceed with this. Like

  1. Should I build the linux executable
  2. After builiding the binary, what changes should I make to linux startup files to run this executable
  3. How my service can register call back function to modify or change or send commands to my service while it is running

How do I stop/workaround Java apps stealing focus in Linux window managers


Lock a mutex multiple times in the same thread
  1. Yes, you should build a Linux binary.

    How to profile my C++ application on linux
    You may want to rephrase your question since I doubt this is the answer you want :-)
  2. You should generally create what is known as an "init" file, which lives in /etc/init.d.

    Running commands though PHP/Perl scripts as a priviledged user on Linux
    Novell has a guide online which you can use to author the file. Note that while the init file is common, the exact method of letting the operating system use it varies depending on the distribution.

    Generating a reasonable ctags database for Boost
  3. This is going to be a marked change for you.

    Where are my ruby gems?
    If you are doing simple actions such as re-loading a configuration file, you can use the signals functionality, especially the SIGHUP/HUP signal which is generally used for this purpose.

    Creating a new window that stays on top even when in full screen mode (Qt on Linux)
    If you require extended communication with your daemon, you can use a UNIX domain socket (think of it as a named pipe) or a network socket.
Another task you are going to need to accomplish is to daemonize your application.

How can I figure out why cURL is hanging and unresponsive?
Generally this is done by first fork()ing your process, then redirecting the stdin/stdout pipes in the child.

There are more details which can be answered by reading this document.


See how-to-migrate-a-net-windows-service-application-to-linux-using-mono.. Under Linux, deamons are simple background processes.

No special control methods (e.g start(), stop()) are used as in Windows.

Build your service as a simple (console) application, and run it in the background.

You can use a tool like daemonize to run a program as a Unix daemon..

70 out of 100 based on 70 user ratings 670 reviews