Comments (4)
@4781121 Write more words, even in your own language please. I don't understand your issue.
Perhaps you are trying to do the following:
- Device an environment variable in your personal .bashrc file.
- Run a program as a service.
- 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.
Sorry! My English is not good.
是的, 就是你说的这个意思, 我无法在程序中获得系统中设置的环境变量, 但我又需要给服务中传入一些参数怎么做呢?
from service.
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.
thx
from service.
Related Issues (20)
- can i use it for an interactive resident memory application?
- Can anyone help me?
- macos: LaunchDaemon Restart implementation should perhaps use kickstart HOT 1
- freebsd: service failed to install
- Container check does not work
- When the service is stopped, getting the service status will return an error of exit status 1
- Logging example fails on Windows Server 2019 HOT 2
- System logs do not work on macOS 12 HOT 1
- The name of the logger is not the name of the service, but the name of the process
- Windows reboot success, but boot fail HOT 2
- In Ubuntu 22.04 start error,but Ubuntu 20.04 start is ok HOT 1
- Linux Systemd Script 'RestartSec' is hard-coded
- The service did not respond to the start or control request in a timely fashion.HELP!!!!! HOT 11
- [SOS] Service is not getting started after updating the OS to macOS 14 HOT 1
- Windows services will only start with the default system account HOT 2
- Windows service get user home is error ? HOT 2
- Will the service main process be forcibly killed by the system when it changes?
- I set the PIDFIle path in the service, but it seems that the pidFile is not generated. Do I need to maintain this file myself?
- PIDFile process wrong
- pidFile should not use double quotes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from service.