?
Solved

Fedora Linux -- how to add a user daemon (server) process

Posted on 2014-04-16
3
Medium Priority
?
729 Views
Last Modified: 2014-04-30
I have a server  "binary_server.exe" that does simple math over network for demonstrating the idea of TCP sockets.  It works fine when I start it, as a regular user, like this

>binary_server.exe &

, on the command like. And I saw it running in the background  with ps -ax | grep binary*
. But the process stayed there only for a couple of hours, and then gone. Don't know who killed it. My first question is:

How can I add this executable (daemon) as a startup process? So I don't have to start it manually.

Another related questions is:  Since the server uses network port 5001 (for example), are there anything needs to be configured in the system, other than just lifting off the firewall (which I did, for this educational server)? Or do I have to start it as the root user?  And I suspect that the OS somehow kills it when it's not active for sometime.

Thanks

ZZ
0
Comment
Question by:zzhang2006
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
rfportilla earned 2000 total points
ID: 40004827
No matter what, you want this to be started from another user account (not your personal user account).  You could use root, but I like to use service specific users to limit security risks.  That user should only have access to the directories and databases required to perform its function.  If this is a stand-alone server with no sensitive information then it is probably fine to use root.

Regarding creating services, I haven't done this in a while, but I found this article that looks pretty easy to follow:

http://kezhong.wordpress.com/2011/11/19/creating-my-own-systemd-service-files-on-fedora-16x86_64/

Regarding running the service on the specified port, who is running it is irrelevant.  You need to be primarily concerned with the firewall settings on the server and any additional firewalls on the network.  There probably is not any application specific firewall.  

I can't say why the service went down when you ran it as your user, but it is possible the service crashed, the session ended, or the server was restarted.  Processes don't typically stop because they are user processes.  

Hope this helps.  Good luck.
0
 
LVL 1

Author Closing Comment

by:zzhang2006
ID: 40032247
This worked, thanks.
0
 
LVL 9

Expert Comment

by:rfportilla
ID: 40033790
Your welcome.  Glad I could help.  :-)
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month9 days, 14 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question