Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-04-16
3
Medium Priority
?
734 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

610 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