Solved

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

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

Don't miss ATEN at NAB Show April 24-27!

Visit ATEN at NAB Show to learn how our "Seamlessly Entertaining" solutions deliver fast, precise video streaming without delays for the broadcasting and media environment. ATEN will showcase its 16x16 Modular Matrix Switch (VM1600) and KVM Over IP Solution (KE6900 series).

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LINUX backups with VEEAM 8 151
list of sudo access for date range 5 34
Migrating a Linux server to VMware 3 106
Enable SPF on IMSVA 6 18
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:

740 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