when is the file /etc/profile and /etc/environment loaded
I use the mldonkey-sever, which started by /etc/rc2.d/S98mldonkey-
server. And the locale is set in the file /etc/profile:
export LC_CTYPE=zh_CN.UTF-8
However, it seems that the file /etc/profile has not been loaded when
the mldonkey-server starts.As a result, mldonkey don't use the right
locale, and the file names which include Chinese characters are
encoded wrong.
Certainly, I could change the S98mldonkey-server file directly and
also ugly. But I don't think it's a good solution. Hence, I'd like to
know, when and how are the file /etc/profile and /etc/environment
loaded, and where is the right place to set the system wide variables
such as locale.
Re: when is the file /etc/profile and /etc/environment loaded
luckyrandom <lucky.random@gmail.com> writes:
[color=blue]
>I use the mldonkey-sever, which started by /etc/rc2.d/S98mldonkey-
>server. And the locale is set in the file /etc/profile:[/color]
[color=blue]
> export LC_CTYPE=zh_CN.UTF-8[/color]
[color=blue]
>However, it seems that the file /etc/profile has not been loaded when
>the mldonkey-server starts.As a result, mldonkey don't use the right
>locale, and the file names which include Chinese characters are
>encoded wrong.[/color]
[color=blue]
>Certainly, I could change the S98mldonkey-server file directly and
>also ugly. But I don't think it's a good solution. Hence, I'd like to
>know, when and how are the file /etc/profile and /etc/environment
>loaded, and where is the right place to set the system wide variables
>such as locale.[/color]
/etc/profile is possibly loaded when someone logs on. In the logon process
( assuming bash is the users shell) first .bash_profile is run, and if it
does not exist then /etc/profile is run.
Note that file names do not include Chinese characters. The filenames are
strings of bytes, which something else interprets as characters.
I do not know about /etc/environment.
Re: when is the file /etc/profile and /etc/environment loaded
luckyrandom <lucky.random@gmail.com> wrote:
[color=blue]
> it seems that the file /etc/profile has not been loaded when
> the mldonkey-server starts.[/color]
Try setting the default locale using the /etc/locale.gen and
/etc/default/locale configuration files.
Run locale-gen before restarting the services.
Regards,
Mark.
--
Mark Hobley,
393 Quinton Road West,
Quinton, BIRMINGHAM.
B32 1QE.
Re: when is the file /etc/profile and /etc/environment loaded
Mark Hobley wrote:[color=blue]
> luckyrandom <lucky.random@gmail.com> wrote:
>[color=green]
>> it seems that the file /etc/profile has not been loaded when
>> the mldonkey-server starts.[/color]
>
> Try setting the default locale using the /etc/locale.gen and
> /etc/default/locale configuration files.
>
> Run locale-gen before restarting the services.
>
> Regards,
>
> Mark.
>[/color]
Some of us prefer to keep such settings in /etc/profile.d, where most Linux
systems allos them to be set on a file-by-file bases by including them from
/etc/profile.d if they end with *.sh.
Manually setting /etc/profile on a system by basis is fraught with hazard.