Solved

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

Posted on 2014-04-16
3
720 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 500 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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
expand ext4 on centos 6 5 69
Syslog-ng works. Now what? How to filter and manage? 8 110
Internal CA server 6 132
Watching Inbound/Outbound Traffic on Server 4 22
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

737 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