Environment variables under Linux view process (program) startup

Source: Internet
Author: User
Tags line editor

background: Due to the recent installation of Linux under the Jira, there is a Chinese plug-in installation, once set up after the boot, it is English, and in the terminal after restarting once again, it seems that plug-in effective, it is back to normal Chinese interface, I first think this involves an environment variable problem, Because when I set up boot services with service Jira start can not find some variables, such as: Get not to the Java home directory, the hint can not find, for this, I added the Java environment variable boot OK, but in English, I know less about English, but still want to use Chinese, Otherwise the plug-in is equal to the white Ann. For this reason, it is necessary to understand the difference between the environment variables of the two, how to view a running program environment variables are as follows two methods: Method one: Get the environment variable by getting the process number: [Email protected]192.168.98.128: ~# PS aux|grep jiraroot2341 25.3 55.0 758544 384956pts/0The resulting PID is:2341View the Environment Variables command for the process as follows: PS Eww-P2341   //get a bunch of environment variablesmethod Two, view the environment information under the proc directory and isolate the environment variable TR' /' '\ n'</proc/2341/environ the difference between two points after a diff is found: (1) Term=linux Term=xterm//This could be when I set the Xterm setting when I was using SECURECRT. This variable is brought in (in: Session options, terminal----, emulation---terminal: xterm)(2) Lang=en_us. utf-8Lang=zh_cn. utf-8  //Here's a problem with the terminal code: en_US and ZH_CN are still different, and here's where the problem may be. now deal with this: export LANG=zh_cn. utf-8Put this line in:/etc/init.d/Jira The first line of this command to start. Export LANG=zh_cn. utf-8Nohup/usr/local/jira/bin/shutdown.sh >/dev/NULL 2>&1& |~ -Usleep100000|~ -nohup/usr/local/jira/bin/startup.sh >/dev/NULL 2>&1&after the above modification, sure enough, success, the guess is correct, the proof. --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------Appendix Question: Nohup Execution of the shell script, just set the global variables can not be passed to the script to use it? Export LOGFILE #这里要导出为环境变量才能被123. SH process using Nohup123. SH &================================================of course, there is no need to export, as long as the source script is OK, the global variable is set to the current shell process, if you want it to be an environment variable to be used by the subsequent shell child process will be export. I was thinking: Why did the Jira start without reading the value of this file? Is it strange that your Jira version is too low? VI/etc/sysconfig/i18n by the start-up and terminal runtime environment variables, and then match the same, this problem and has been resolved. --------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------attached below: The environment variable after boot start and the environment variable that the terminal starts to produce the reason: the first clear in the Linux inside whether is in the command line input or the system setting and so on all belongs to the shell. (Boot start settings are set at (/ETC/INIT.D/RCS), the shell that configures the system environment variable is located in/etc/profile, the shell that configures the user-level environment variable is executed for ~/.bashrc-each startup terminal, or ~/. bash_profile-session at the beginning of execution). Add the path of the library to the environment variable Ld_lib_path to find it. Memo:1, the command line editor can be edited using Emacs commands, such as ctrl-b means to step back; Ctrl-A indicates that the cursor is moved to the front and so on. 2, you can enter several command sequence execution: Command1; Command2 or Command1 &&Command2 (executes Command2 when Command1 executes successfully). 3, background run, and program debug output redirection: After running a program in the terminal, you can suspend it with ctrl-z and enter the BG command to make it run in the background (or, of course, add &). Command & >/dev/NULL&The terminal output debugging information will no longer be. 4, Output redirection: (1) Multiple command redirection, | such as | grep text | Less etc., (2Redirect to document command > file (change file contents to command output) or command >>file (directly after the command output is appended to the file). 5, change prompt: by setting ps1="something. 6, with alias Newcommand="Oldcommand" sets the alias of the command. 1.2. 6410 boot start and environment variable settings1, boot boot program added to shell file/etc/init.d/in the RCS file2, environment variables are added in the/etc/profile file (PATH and Ld_library_path)

Environment variables under Linux view process (program) startup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.