OS-8459: Remove csh from SmartOS, use wrapper to pkgsrc tcsh instead

Details

Issue Type:Improvement
Priority:4 - Normal
Status:Resolved
Created at:2023-04-10T14:43:06.227Z
Updated at:2023-05-03T04:15:36.496Z

People

Created by:Dan McDonald
Reported by:Dan McDonald
Assigned to:Dan McDonald

Related Issues

Related Links

Description

illumos#15476 allows IPS distros to mediate csh to use tcsh in its stead. Our ramdisk root means for csh we either need to keep it or have it be adaptable to whether or not it’s in pkgsrc. With pkgsrc-in-global changes ( TRITON-2258 ), we can write a detector script to drop where /usr/bin/csh lives and have it detect whether or not tcsh is available for substitution. We have announced this to the SmartOS community concurrent to this issue being filed, and are making it public immediately.

Comments

Comment by Dan McDonald
Created at 2023-04-16T16:51:43.537Z
Updated at 2023-04-16T16:51:55.232Z

Tested on Kebecloud compute nodes and head node. Their GZs did not have pkgsrc tools installed, so the “install tcsh” diagnostic was printed appropriately. NGZs with tcsh already installed executed /opt/local/bin/tcsh for /usr/bin/csh per design. The "thinks it's installed but fails" failure path has not been probed as of this update.


Comment by Dan McDonald
Created at 2023-04-20T15:47:04.183Z

New C version of pkgsrc remapper fixes:

Tested on Kebecloud compute node using a user account that rotated through shells including pksrc-remapped entries in


Comment by Dan McDonald
Created at 2023-04-20T17:40:01.366Z

More testing results. Each login below was with a different SHELL in `/etc/passwd`:

/opt/local/bin/tcsh
/bin/tcsh
/bin/csh
/bin/zsh

Note that zsh is not installed on the zone under test:

[danmcd@temple ~]$ ssh 172.24.4.184
Password: 

  ,---.                   |     ,---. ,---.
  `---. ,-.-. ,---. ,---. |---  |   | `---.  base-64-lts
      | | | | ,---| |     |     |   |     |  21.4.1
  `---' ` ' ' `---' `     `---' `---' `---'

smartos-build(~)[0]% ptree $$
7822   zsched
  12765  /sbin/init
    22669  /usr/lib/ssh/sshd
      23493  /usr/lib/ssh/sshd -R
        23501  /usr/lib/ssh/sshd -R
          23502  -tcsh
            23513  ptree 23502
smartos-build(~)[0]% logout
Connection to 172.24.4.184 closed.
[danmcd@temple ~]$ ssh 172.24.4.184
Password: 

  ,---.                   |     ,---. ,---.
  `---. ,-.-. ,---. ,---. |---  |   | `---.  base-64-lts
      | | | | ,---| |     |     |   |     |  21.4.1
  `---' ` ' ' `---' `     `---' `---' `---'

smartos-build(~)[0]% ptree $$
7822   zsched
  12765  /sbin/init
    22669  /usr/lib/ssh/sshd
      23524  /usr/lib/ssh/sshd -R
        23535  /usr/lib/ssh/sshd -R
          23536  -tcsh
            23548  ptree 23536
smartos-build(~)[0]% logout
Connection to 172.24.4.184 closed.
[danmcd@temple ~]$ ssh 172.24.4.184
Password: 

  ,---.                   |     ,---. ,---.
  `---. ,-.-. ,---. ,---. |---  |   | `---.  base-64-lts
      | | | | ,---| |     |     |   |     |  21.4.1
  `---' ` ' ' `---' `     `---' `---' `---'

smartos-build(~)[0]% ptree $$
7822   zsched
  12765  /sbin/init
    22669  /usr/lib/ssh/sshd
      23561  /usr/lib/ssh/sshd -R
        23567  /usr/lib/ssh/sshd -R
          23568  -csh
            23581  ptree 23568
smartos-build(~)[0]% logout
Connection to 172.24.4.184 closed.
[danmcd@temple ~]$ ssh 172.24.4.184
Password: 
Please install zsh from pkgsrc.
Connection to 172.24.4.184 closed.
[danmcd@temple ~]$ 

Comment by Dan McDonald
Created at 2023-04-20T19:41:24.511Z

More testing per CR request:

martos-build(~)[0]% /tmp/csh.test 
7822   zsched
  12765  /sbin/init
    22669  /usr/lib/ssh/sshd
      25233  /usr/lib/ssh/sshd -R
        25237  /usr/lib/ssh/sshd -R
          25238  -tcsh
            25262  /usr/bin/csh /tmp/csh.test
              25269  ptree 25262
smartos-build(~)[0]% vi /tmp/csh.test  <=== KEBE SAYS change /usr/bin/csh to /opt/local/bin/tcsh
smartos-build(~)[0]% /tmp/csh.test
7822   zsched
  12765  /sbin/init
    22669  /usr/lib/ssh/sshd
      25233  /usr/lib/ssh/sshd -R
        25237  /usr/lib/ssh/sshd -R
          25238  -tcsh
            25273  /opt/local/bin/tcsh /tmp/csh.test
              25280  ptree 25273
smartos-build(~)[0]% 
smartos-build(~)[0]% vi /tmp/csh.test <=== KEBE SAYS replace with uninstalled zsh
smartos-build(~)[0]% /tmp/csh.test 
Please install zsh from pkgsrc.
smartos-build(~)[1]%