Why .cshrc and .profile in / ?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Why .cshrc and .profile in / ?

Worik Stanton
In a fresh(ish) OpenBSD installation I note .cshrc and .profile in /.

Why?

Worik
--
Why is the legal status of chardonnay different to that of cannabis?
       [hidden email] 021-1680650, (03) 4821804
                          Aotearoa (New Zealand)
                             I voted for love

Reply | Threaded
Open this post in threaded view
|

Re: Why .cshrc and .profile in / ?

Daniel Dickman
On Sun, Oct 19, 2014 at 6:32 PM, worik <[hidden email]> wrote:
> In a fresh(ish) OpenBSD installation I note .cshrc and .profile in /.
>
> Why?
>

Not sure there's an answer but it was discussed at least one time before:
http://marc.info/?t=119103079700001&r=1&w=2

Reply | Threaded
Open this post in threaded view
|

Re: Why .cshrc and .profile in / ?

Worik Stanton
On 20/10/14 11:50, Daniel Dickman wrote:
> On Sun, Oct 19, 2014 at 6:32 PM, worik <[hidden email]> wrote:
>> In a fresh(ish) OpenBSD installation I note .cshrc and .profile in /.
>>
>> Why?
>>
>
> Not sure there's an answer but it was discussed at least one time before:
> http://marc.info/?t=119103079700001&r=1&w=2
>

There are some theories there, but no facts.

Puzzlement

Worik

--
Why is the legal status of chardonnay different to that of cannabis?
       [hidden email] 021-1680650, (03) 4821804
                          Aotearoa (New Zealand)
                             I voted for love

[demime 1.01d removed an attachment of type application/pgp-signature which had a name of signature.asc]

Reply | Threaded
Open this post in threaded view
|

Re: Why .cshrc and .profile in / ?

Mike Jackson
In reply to this post by Worik Stanton
Quoting worik <[hidden email]>:

> In a fresh(ish) OpenBSD installation I note .cshrc and .profile in /.
>
> Why?


bin:*:3:7:Binaries Commands and Source:/:/sbin/nologin

Reply | Threaded
Open this post in threaded view
|

Re: Why .cshrc and .profile in / ?

Craig Skinner-3
In reply to this post by Worik Stanton
On 2014-10-20 Mon 11:32 AM |, worik wrote:
> In a fresh(ish) OpenBSD installation I note .cshrc and .profile in /.
>

Rename them to /.cshrc~ & /.profile~ and see what breaks...

I always delete them due to having /etc/{profile,csh.cshrc,csh.login}

install.site (http://www.openbsd.org/faq/faq4.html#site):

cd /
rm .cshrc .profile

# Tidy up /root
cd /root
rm .klogin .Xdefaults .profile .cshrc .login

...
..
cd /etc
cat rc.firsttime.run >> rc.firsttime


And this in rc.firsttime(8):

...
..
cd /etc
...
..

# Tidy skel/
grep -v '^set path = ' skel/.cshrc | grep -v 'set mail = ' >> csh.cshrc
cat skel/.login >> csh.login
rm skel/{.Xdefaults,.cshrc,.login,.mailrc,.profile}
chmod 700 skel

...
..


PATH, MAIL & umask are defined once in /etc/login.conf - for all shells.

# /etc/profile:

[[ -o interactive ]] &&
{
        [[ ${SHELL} == '/bin/ksh' ]] && . /etc/ksh.kshrc
        [[ ${SHELL} == '/bin/rksh' ]] && . /etc/ksh.kshrc 2>/dev/null

        [[ -x /usr/bin/tset ]] &&
        {
                [[ -n ${XTERM_VERSION} ]] && I='I'
                eval $(/usr/bin/tset -${I}sQ '-munknown:?vt220' ${TERM})
        }
}

[[ -f /etc/proxy.conf ]] && . /etc/proxy.conf

Reply | Threaded
Open this post in threaded view
|

Re: Why .cshrc and .profile in / ?

Ingo Schwarze
Hi Craig,

Craig R. Skinner wrote on Wed, Oct 22, 2014 at 10:47:40AM +0100:
> On 2014-10-20 Mon 11:32 AM |, worik wrote:

>> In a fresh(ish) OpenBSD installation I note .cshrc and .profile in /.

> Rename them to /.cshrc~ & /.profile~ and see what breaks...
> I always delete them due to having /etc/{profile,csh.cshrc,csh.login}

That is not necessarily be good advice, depending on the circumstances,
and depending on what you put into the files below /etc.  You may
only see what breaks when it is too late.

The purpose of the shell dot files in / is to have safe fallbacks
when the home directory of a non-privileged user logging in is
currently unavailable.  That may for example happen when /home
is on NFS, or when the disk containing it is physically broken
or just happens to be unmounted.

Yours,
  Ingo