Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: /etc/profile

  1. #11
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    2,663

    Cool Re: /etc/profile

    Quote Originally Posted by nrickert View Post
    I'm an old fashioned traditionalist with respect to "/etc/profile".
    As an old-fashioned DEC Ultrix, DEC RSX-11M, DEC RSTS/E and DEC VAX/VMS traditionalist and, an openSUSE fan, my personal view is, the system should in 99.999% of the cases simply install and run -- without any additional effort being needed to set-up the system -- apart from the user definitions -- which may be available (these days) via LDAP …

    I find that, the SUSE solution to have administrator changes to '/etc/profile' being included via '/etc/profile.local', is an acceptable solution to the dilemma of some sites NEEDING to personalise the default system profile …

  2. #12
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,696
    Blog Entries
    2

    Default Re: /etc/profile

    Quote Originally Posted by nrickert View Post
    I'm an old fashioned traditionalist with respect to "/etc/profile".

    In my opinion, the distro should not provide "/etc/profile". That file properly belongs to the local system administrator, not to the vendor.

    The distro should provide "/etc/profile.example", but not "/etc/profile".

    At the end of a clean install, if there is no "/etc/profile", then it should copy "/etc/profile.example" to "/etc/profile". But that would be done as a final install step, not as part of a package install.

    If done that way, a forced update of "aaa_base" would replace "/etc/profile.example" with the correct version. It would be up to the local system administrator to then copy that to "/etc/profile" if desired.

    Most linux distros seem to get this wrong (in my opinion).


    I'm of the opinion that everything should be modularized to support maximum flexibility and versatility.

    To do this,
    There should always be a commonly accepted default base, inviolate.
    This means that no one should make modifications to this.

    Then there should be a way to <separately> modify what is basic.

    For most distros and including openSUSE today,
    You have 2 ways to do this...

    - Create an /etc/profile.local file which contains your customizations
    - Create a script file that is then placed in /etc/profile.d/

    By separating what is default and what is custom, there is no need to document changes or worry about lost configurations, all customizations are easy to identify. Editing /etc/profile can result in changes and machine settings impossible for anyone to find later.

    I haven't actually tried to use any of the two methods to disable, remove or modify a default setting in /etc/profile,
    I've only added settings...

    If someone were to edit /etc/profile directly though, I'd suggest leaving some almost unmistakable indication some change was made, like saving a copy of the default as /etc/profile.original
    That way, hopefully someone sharp-eyed would notice the unusual file and start to ask questions... But of course, this still wouldn't be certain.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #13
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,171

    Default Re: /etc/profile

    Quote Originally Posted by dcurtisfra View Post
    You didn't provoke any wrongdoings …
    • It seems that, the RPM rules in the 'aaa_base' package ensure that, any administrator changes to "/etc/profile" are preserved -- without a "/etc/profile.rpmnew" being written.
    • A "diff -cw profile profile.good" would have been helpful.

    The workaround for such cases is, to download the .rpm package file and extract the miscreant file with something such as KDE "Ark".
    Then, the decision can be made to either edit the differences into the existing system file or, to simply replace it.
    Simpler just to delete the bad profile and reinstall.

    For the sake of completeness:
    Code:
    ns3:~ # cd /etc
    ns3:/etc # 
    ns3:/etc # lh -d profile*
    -rw-r--r-- 1 root root 9.0K Apr  3 19:00 profile
    drwxr-xr-x 2 root root 1.2K Apr  3 18:32 profile.d
    -rw-r--r-- 1 root root 9.0K Jul  7  2017 profile.good
    
    ns3:/etc # diff profile profile.good
    387d386
    < #\n# test\n#
    
    ns3:/etc # rm profile   
    ns3:/etc # lh -d profile*
    drwxr-xr-x 2 root root 1.2K Apr  3 18:32 profile.d
    -rw-r--r-- 1 root root 9.0K Jul  7  2017 profile.good
    
    ns3:/etc # zypper install --force aaa_base
    Retrieving repository '42.3-Packman' metadata ................................[done]
    Building repository '42.3-Packman' cache .....................................[done]
    Loading repository data...
    Reading installed packages...
    Forcing installation of 'aaa_base-13.2+git20140911.61c1681-27.2.x86_64' from repository '42.3-Repo-oss'.
    Resolving package dependencies...
    
    The following package is going to be reinstalled:
      aaa_base
    
    1 package to reinstall.
    Overall download size: 132.5 KiB. Already cached: 0 B. No additional space will be
    used or freed after the operation.
    Continue? [y/n/...? shows all options] (y): 
    Retrieving package aaa_base-13.2+git20140911.61c1681-27.2.x86_64
                                                   (1/1), 132.5 KiB (262.2 KiB unpacked)
    Retrieving: aaa_base-13.2+git20140911.61c1681-27.2.x86_64.rpm ..[done (241.8 KiB/s)]
    Checking for file conflicts: .................................................[done]
    (1/1) Installing: aaa_base-13.2+git20140911.61c1681-27.2.x86_64 ..............[done]
    Additional rpm output:
    Updating /etc/sysconfig/language...
    Updating /etc/sysconfig/backup...
    Updating /etc/sysconfig/proxy...
    Updating /etc/sysconfig/windowmanager...
    Updating /etc/sysconfig/news...
    Updating etc/passwd...unchanged
    Updating etc/group...unchanged
    Updating etc/shadow...unchanged
    
    
    ns3:/etc # lh -d profile*
    -rw-r--r-- 1 root root 9.0K Jul  7  2017 profile
    drwxr-xr-x 2 root root 1.2K Apr  4 18:01 profile.d
    -rw-r--r-- 1 root root 9.0K Jul  7  2017 profile.good
    
    ns3:/etc # diff profile profile.good
    ns3:/etc
    As a thought, a system upgrade possibly drops a '.rpmnew' copy into '/etc/' …
    Not as far as I can tell from the workstations that were upgraded.
    I then tested whether an old tainted profile would be replaced, but apparently not.
    Code:
    ns3:/etc # echo "#\n# test\n#" >> profile                                   
    
    ns3:/etc # touch -d2000-01-01 00:01:00 profile
    
    ns3:/etc # diff profile profile.good     
    387d386
    < #\n# test\n#
    ns3:/etc # l -d profile*
    -rw-r--r-- 1 root root 9181 Jan  1  2000 profile
    drwxr-xr-x 2 root root 1192 Apr  4 18:01 profile.d/
    -rw-r--r-- 1 root root 9168 Jul  7  2017 profile.good
    
    ns3:/etc # zypper install --force aaa_base 
     ...
    
    ns3:/etc # diff profile profile.good     
    387d386
    < #\n# test\n#
    ns3:/etc # l -d profile*
    -rw-r--r-- 1 root root 9181 Jan  1  2000 profile
    drwxr-xr-x 2 root root 1192 Apr  4 18:39 profile.d/
    -rw-r--r-- 1 root root 9168 Jul  7  2017 profile.good
    I have seen old thread about a script that was missing th continuation “\”s. I will try to find it.
    --
    slàinte mhath,
    rayH

    ~ It is harder to ask the correct question than to know the correct answer.

  4. #14
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    2,663

    Exclamation Re: /etc/profile

    Patch openSUSE-2018-331 dated Thursday the 5th of April 2018:
    Code:
        This update for aaa_base provides the following fixes:
    
        - Support changing PS1 even for mksh and user root. (bsc#1036895)
        - Unset unused variables on profile files. (bsc#1049577)
        - Unset id in csh.cshrc instead of profile.csh. (bsc#1049577)
        - Allow that personal ~/.bashrc is read again. (bsc#1052182)
        - Avoid that IFS becomes global in _ls ksh shell function. (bsc#1079674, bsc#1025743)
        - Replace "cat > file" by "mv -f ... file" in pre/post to fix issues with clients
          having these files mmapped. (bsc#1038549)

    No comment.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •