Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8191299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:53:16+00:00 2026-06-07T03:53:16+00:00

I have created a Linux daemon (in C language) to send certain information via

  • 0

I have created a Linux daemon (in C language) to send certain information via UDP to another computer. It requires of course the remote IP address and the port number. I store this daemon in /usr/local/bin/ and I also created a script in /etc/init.d/ to start|stop|restart the daemon.

So far, the IP address and the port number are passed to the daemon, directly by the script. By example, the start() part of the script looks like this:

start() {
  /usr/local/bin/lvsload_udp_s 192.168.122.25 47239
}

So, when the remote IP and/or port number changes, I have to modify my script, instead of modifying some configuration file. It is a bad practice, I know.

What is the best way of passing the arguments to my daemon? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:53:17+00:00Added an answer on June 7, 2026 at 3:53 am

    Why do you think command line parameters are bad?

    Configuration files are additional work, since you need to parse them. And going with your example, modifying a configuration file = modifying one file. Modifying a script = modifying one file. Doesn’t seem like much of a difference, when you only have a small number of arguments. You can even stick the parameters into variables at the top of the script, which makes it almost like a config file 🙂 Some scripts even source such “variable setting scripts” so it really looks like a configuration file.

    If you can find a reason why command line parameters are bad, then there’s a good chance that you’ll also have an idea what to use instead. If, on the other hand, you can’t even explain why the command line parameters are bad, then there’s probably nothing wrong with using them…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple linux 32bit shared library(.so) for my rendering wrappers but
I have created a java application for Debian Linux. Now I want that that
I am on linux mint 12. I have created a virtualenv called userena .
I have debian linux. I've created from user crontab -e this text: 0 *
I have created a NPAPI browser plugin for Firefox on linux. I installed the
OS: Linux(RedHat) Programming Language: C++ I need to create a daemon(process) for Linux using
I have created a linux service that runs as a deamon (and gets started
Linux Server Box running WebSphere MQ Server v7.1: I have created a user 'mq-user'
Hi I am using Fedora 10 linux. I have created a .spec file now
I am using 64 bit fedora10 linux. I have created rpm file for my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.