From owner-freebsd-questions@freebsd.org Fri Aug 26 12:34:30 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50B62B704C8 for ; Fri, 26 Aug 2016 12:34:30 +0000 (UTC) (envelope-from roger@qxxy.com) Received: from mail-ua0-x230.google.com (mail-ua0-x230.google.com [IPv6:2607:f8b0:400c:c08::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FBC472 for ; Fri, 26 Aug 2016 12:34:30 +0000 (UTC) (envelope-from roger@qxxy.com) Received: by mail-ua0-x230.google.com with SMTP id l94so72018758ual.0 for ; Fri, 26 Aug 2016 05:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qxxy.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=O5EJ3T+Mu2ppgsWSQMEcVfi7vamC1mm7DFWa4b4rD3o=; b=B2jyIOdtVH6dNX1L9a1TePlwm6NW/AlcmyULKk0Sh8yi/5Hg3T9WQKJbLk9LmbFuhU QCzkTk27PrzZeb6A+T3OcV8KXOkaQK34r2NlFec3dbEJVxH6yNB/5rMpVpx10oWI5/ci t8kzq2kKvv0MLPwqhAaiInnnvQK2coJ2vlCUU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=O5EJ3T+Mu2ppgsWSQMEcVfi7vamC1mm7DFWa4b4rD3o=; b=XY1gBSTnZ8SUR4dl1A7d30EMilv4FAL5d1H10jtbz5Gn3YybOJYw3HdaUdl7hB5hmB Uf6VTtl8weJMlNqMxzN0rYrWbdmziLoXQM7Z7BDb3qdWANdIylf+Oj7KMsbZHKSq/GsF erukOqlwPNFsZ0Gh8Gx8Bzr3BIg5+amjArWakBlGi90ivSwlBfvibBk4SjlxFqSbiFLw aaGQ6XPnJGqccGmuuPqqlT/BLvQuePXlnStWTHCiZN/2EnEvjxiHP+aZa92s5hhJpTXQ SNwkqzK/djDh4WhJMgTK1YfUIPxRcE+TXMEnhkPD537mB3z2QWv3d4MIyfKrSsjcwnz3 eEcg== X-Gm-Message-State: AE9vXwPcv6TaUoKJ1A4LbRXnRaFk9XiRPTPylB1VnOMa7tNNLBoObDl32P+9WlyzCQCsqw/GHWzHmAxQ4FHFpw== X-Received: by 10.176.64.100 with SMTP id h91mr1449345uad.59.1472214868730; Fri, 26 Aug 2016 05:34:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.78.157 with HTTP; Fri, 26 Aug 2016 05:33:48 -0700 (PDT) X-Originating-IP: [50.90.149.220] In-Reply-To: <20160826111512.GA70960@becker.bs.l> References: <20160826111512.GA70960@becker.bs.l> From: Roger Pate Date: Fri, 26 Aug 2016 08:33:48 -0400 Message-ID: Subject: Re: login.conf: tc overwrites setenv To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 12:34:30 -0000 $ ssh otherhost cat .login_conf # $FreeBSD: releng/10.2/share/skel/dot.login_conf 77995 2001-06-10 17:08:53Z ache $ # # see login.conf(5) # me:\ :setenv=WASHERE=42: $ ssh -t otherhost env | grep WASHERE WASHERE=42 On Fri, Aug 26, 2016 at 7:15 AM, Bertram Scharpf wrote: > Hi, > > when I enter a displayless machine I want to start TMux > immediately: > > $ ssh -t otherhost tmux -u > > Yet, this bypasses /etc/profile before the TMux server is > started. As soon as TMux opens its first pane, a shell is > opened and /etc/profile comes into respect. But while TMux > is setting up its mode-keys option, it won't detect the > EDITOR=vi in the profile. Therefore I added the EDITOR > environment variable to /etc/login.conf. > > default:\ > :setenv=[...],EDITOR=vi:\ > :[...]: > > This works as long as I only use the "default" section. > However, when I change the login class in vipw to "german" > the effect disappears. > > german|German Users Accounts:\ > :charset=UTF-8:\ > :lang=de_DE.UTF-8:\ > :setenv=LC_COLLATE=C:\ > :tc=default: > > The tc directive imports all directives from "default" but > then, "setenv" is overwritten. > > I thorougly examined this behaviour by setting further > environment variables and by not calling TMux but a simple > variable dump (see below). > > Is there a way to merge the setenv directives? > > Is there any better solution to my problem? On a Linux > machine I solved it by calling pam_env in /etc/pam.d/sshd > , > but I can find no pam_env in FreeBSD. > > Thanks in advance. > > Bertram > > > ________________________________________________________________ > In /etc/login.conf: > > default:\ > :setenv=[...],EDITOR=vi,WASHERE_DEFAULT=x:\ > :[...]: > > german|German Users Accounts:\ > :charset=UTF-8:\ > :lang=de_DE.UTF-8:\ > :setenv=LC_COLLATE=C,WASHERE_GERMAN=x:\ > :tc=default: > > ----------------------------------------------------- > #include > #include > > int main(int argc, char **argv, char **env) > { > char **e; > > for (e = env; *e != 0; e++) > printf( "%s\n", *e); > return 0; > } > ---------------------------------------------------------------- > > Shell command: > > $ ssh -t otherhost ./showenv | grep ^WASHERE > > > > -- > Bertram Scharpf > Stuttgart, Deutschland/Germany > http://www.bertram-scharpf.de > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"