Giter VIP home page Giter VIP logo

Comments (4)

kardianos avatar kardianos commented on August 25, 2024

@4781121 Write more words, even in your own language please. I don't understand your issue.

Perhaps you are trying to do the following:

  1. Device an environment variable in your personal .bashrc file.
  2. Run a program as a service.
  3. Try to access your environment variable in your program.

That won't work by definition. Services don't run in bash. They don't start in bash. .bashrc doesn't ever get used. That's why it's called a system service.

from service.

4781121 avatar 4781121 commented on August 25, 2024

Sorry! My English is not good.
是的, 就是你说的这个意思, 我无法在程序中获得系统中设置的环境变量, 但我又需要给服务中传入一些参数怎么做呢?

from service.

kardianos avatar kardianos commented on August 25, 2024

To give the program a parameter I would recommend using either a
configuration file or or when installing the service, arrange for the
configuration "Arguments" parameter to store the parameters. Then the given
"Arguments" will be passed into the program each time it is ran.

So, for service install, set Config.Arguments. Then when running the
arguments (os.Args) will be passed in automatically to your program.

Close this issue if this makes sense to you.

via google translate:
为了给该计划的一个参数,我建议使用一个配置文件或者或安装服务时,安排配置“参数”参数存储的参数。然后给定的“论据”,将它跑了,每次被传递到程序中。

因此,对于服务的安装,设置Config.Arguments 。然后运行参数( os.Args )时,会自动传递到您的程序。

关闭这个问题,如果这对你有意义。

On Wed, May 27, 2015 at 2:11 AM Felix Chang [email protected]
wrote:

Sorry! My English is not good.
是的, 就是你说的这个意思, 我无法在程序中获得系统中设置的环境变量, 但我又需要给服务中传入一些参数怎么做呢?


Reply to this email directly or view it on GitHub
#24 (comment).

from service.

4781121 avatar 4781121 commented on August 25, 2024

thx

from service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.