when is the file /etc/profile and /etc/environment loaded - Setup

This is a discussion on when is the file /etc/profile and /etc/environment loaded - Setup ; 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 ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: when is the file /etc/profile and /etc/environment loaded

  1. 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.

  2. Re: when is the file /etc/profile and /etc/environment loaded

    luckyrandom writes:

    >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.


    /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.


  3. Re: when is the file /etc/profile and /etc/environment loaded

    luckyrandom wrote:

    > it seems that the file /etc/profile has not been loaded when
    > the mldonkey-server starts.


    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.

  4. Re: when is the file /etc/profile and /etc/environment loaded

    Mark Hobley wrote:
    > luckyrandom wrote:
    >
    >> it seems that the file /etc/profile has not been loaded when
    >> the mldonkey-server starts.

    >
    > 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.
    >


    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.

+ Reply to Thread