From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=DKIM_ADSP_ALL,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 10724 invoked from network); 12 Aug 2020 15:56:27 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Aug 2020 15:56:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=WUJeddsVKlcb6BudH3OGqXQeI1IUBWZOD6VNw8z/eHw=; b=ajRkSl0I3oFp1nT+wHkJTils6M AK1lF+abU07XKk687CYM8e47Oq9RVRi4xZ124I9m5J3iqQuq2ybdkWXMILn0Hw3W8BxFw0h9X9kj2 jiG73UrlIUCTg1mvq74xsTuAt01icr8mNm9gqto+/Gk5jMCgs3dZU03E5vC1J1gzP3S1JOWSRqRdd PH3PNUT/Rn5+CkmoqKgSAjOvlyq1Jbt61x5Jf5fkplJDrzGRsGO/12Ipm7sySUktiti+UIwzhbeuI J/YVojyjSb19bb7BUJqWLE4oYGyl2UMbnN7sKBUu3NFlnopWD+yBw1vwJV3Gpte/2RD1a4qYZIa0P zXZJCJ2A==; Received: from authenticated user by zero.zsh.org with local id 1k5t72-000JHZ-2o; Wed, 12 Aug 2020 15:56:24 +0000 Authentication-Results: zsh.org; iprev=pass (mx.spodhuis.org) smtp.remote-ip=94.142.241.89; dkim=pass header.d=spodhuis.org header.s=d202008 header.a=rsa-sha256 Received: from mx.spodhuis.org ([94.142.241.89]:57640) (DNSSEC AD) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1k5t6b-000Iue-9h; Wed, 12 Aug 2020 15:55:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d202008; h=In-Reply-To:Content-Type:MIME-Version:References :Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=WUJeddsVKlcb6BudH3OGqXQeI1IUBWZOD6VNw8z/eHw=; b=Q5QDbv80IZjFL8Eo2IGJwi6khd WOGPVoyKxQJQTgcqiwsllmxR34Os2EZP0UL1ABrUC3X1sSfEKBOLrrJFM1NV8jeo23h9CCD+jt/Kj QGTmmbuAN36QT0dfeTbf0mdNpPCDb/uypRg/9R32mppq2IoXsv0oS6myZ8L4YpfOSRiELB+Tan31H 1QW680UB9yeAcXUoP+HgUxpMSfZfn3uMH4huU/JUb7Lilc6O2nO/sUP3OOEq5T02xIltHLg6mD56j LXLVFfD2b4nVEMiWf2YEDOvw3fT362YxApmp60b3mCujSqixXnUW/6eRjrP4Nr+GCUF793dScNCUO wtwZebnQ==; DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d202008e2; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WUJeddsVKlcb6BudH3OGqXQeI1IUBWZOD6VNw8z/eHw=; b=QcasDt6ElLNrn8uQV8mhlLC7+ HV9/d0LAzPpvdisqUxFiLN6OGx63ex5qdO3tfY1SLmblgHFcjn4FCWiqVGQAw==; Received: from authenticated user by smtp.spodhuis.org with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) id 1k5t6Z-000IuU-R2; Wed, 12 Aug 2020 15:55:56 +0000 Date: Wed, 12 Aug 2020 11:55:52 -0400 From: Phil Pennock To: rdong1989@gmail.com Cc: zsh-user Subject: Re: Fwd: sshfs crash with zsh Message-ID: <20200812155552.GA77916@fullerene.field.pennock-tech.net> References: <1779408280.1081846.1597227236848@mail2.virginmedia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1779408280.1081846.1597227236848@mail2.virginmedia.com> OpenPGP: url=https://www.security.spodhuis.org/PGP/keys/keys-2013rsa-2020cv25519.asc X-Zsh-Org-Should-ARC-Sign: true X-Seq: 26018 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On 2020-08-12 at 01:25, Rui Dong wrote: > I am a fan of zsh, and used it for many years. Recently I found when I > configure the server with zsh, I could not mount the disk with sshfs. If I > comment the "exec /bin/zsh --login" out, sshfs works again. Could you > please help with this? It sounds like you're trying to change your shell in user configuration files without changing the login user's shell in the system records. And then you're doing this in a configuration file used for all logins, even non-interactive ones. So when some other command tries to log in, your shell switch is happening and discarding the actual commands to be run. You probably want to use the `chsh` command to change the shell instead. Or `vipw` or whatever else changes the shell in the `/etc/passwd` file: the last field on the line for your user specifies the shell. If you _have_ to use configuration files, then make sure that you only change shells, or run any command which produces output to stdout or stderr, if the shell is interactive. How you do that depends upon the shell which is being used, and which configuration file you edit. Check the manual-page for guidance on which file to be edited. If one configuration file is used for both interactive and non-interactive use, and there's no other file you can use, then you can use conditional logic to wrap around the exec and only call that when interactive. The syntax depends upon the shell (csh, bash, whatever). There are two traditional approaches for "what to test": 1. You can look at $PS1, as long as nothing is polluting the environment by exporting it: PS1 will only be set by shells when the shell is interactive, because this is the main variable used to define what your command prompt looks like. But sloppy practices (exporting PS1) will ruin this. 2. The shell might have a variable which lists which options are in effect, and you can check for the interactive option in that. For instance, with the bash shell, you might check for `i` in `$-`: if [[ $- == *i* ]]; then exec /bin/zsh --login fi More than that, we can't help you with, as there are too few details in your mail about your setup. Regards, -Phil