Package: manpages
Version: 5.10-1
Severity: minor
Tags: upstream patch

Dear Maintainer,

Modern system use loginctl and pam to set environ.

It avoid error in graphical application.

Setting environ with pam_env is the way to go.

Document it.


Bastien
>From 24702f5fd6bd64cecafb853c15dae7819c078a22 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20Roucari=C3=A8s?= <[email protected]>
Date: Wed, 13 Jan 2021 08:43:30 +0000
Subject: [PATCH] Improve documentation of environment variables

Document how to configure this file
---
 man7/environ.7 | 55 +++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 43 insertions(+), 12 deletions(-)

diff --git a/man7/environ.7 b/man7/environ.7
index a8606d0..79e15a4 100644
--- a/man7/environ.7
+++ b/man7/environ.7
@@ -137,18 +137,9 @@ or by the
 command if you use
 .BR csh (1).
 .PP
-The initial environment of the shell is populated in various ways,
-such as definitions from
-.IR /etc/environment
-that are processed by
-.BR pam_env (8)
-for all users at login time (on systems that employ
-.BR pam (8)).
-In addition, various shell initialization scripts, such as the system-wide
-.IR /etc/profile
-script and per-user initializations script may include commands
-that add variables to the shell's environment;
-see the manual page of your preferred shell for details.
+The initial environment of the shell is populated in various ways. See the
+.I CONFIGURATION
+section for details.
 .PP
 Bourne-style shells support the syntax
 .PP
@@ -233,6 +224,44 @@ tell applications about the window size, possibly overriding the actual size.
 may specify the desired printer to use.
 See
 .BR lpr (1).
+.SH CONFIGURATION
+On system that employ
+.BR pam(8),
+suitable configuration
+file for environment variable settings
+that affect the system as a whole (rather than just a particular user) are
+.IR /etc/environment
+or preferably configuration files included from
+.IR /etc/environment.d/
+configuration subdirectory.
+These files
+are processed by
+.BR pam_env (8)
+for all users at login time.
+See
+.BR pam_env (8)
+for syntax of these files.
+.PP
+On system that employ
+.BR pam(8),
+suitable file for environment variable settings that should affect just a particular user (rather than the system as a whole) is
+the user writtable
+.IR $HOME/.pam_environment
+file.
+See
+.BR pam_env.conf (5)
+for syntax. This file is processed at login time by
+.BR pam (8),
+and so setting variables using this mecanism
+is prefered for userwise customization.
+.PP
+In addition, various shell initialization scripts, such as the system-wide
+.IR /etc/profile
+script and per-user initializations script may include commands
+that add variables to the shell's environment;
+see the manual page of your preferred shell for details. Note however, that variable set
+by initialization scripts of your prefered shell, may not affect graphical applications.
+.PP
 .SH NOTES
 The
 .BR prctl (2)
@@ -295,7 +324,9 @@ should consider renaming their option to
 .BR unsetenv (3),
 .BR locale (7),
 .BR ld.so (8),
+.BR pam (8)
 .BR pam_env (8)
+.BR pam_env.conf (5)
 .SH COLOPHON
 This page is part of release 5.10 of the Linux
 .I man-pages
-- 
2.29.2

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to