From ae24e7d34afe3d68226e0821c480a5051931bccb Mon Sep 17 00:00:00 2001 From: Alex Tsariounov Date: Thu, 9 Jun 2011 13:20:23 -0400 Subject: [PATCH] Fix for Issue #5 (LOGNAME not set on exec with --user parameter) Also updated dates and some incorrect texts. --- INSTALL | 2 +- NEWS | 11 +++++++++++ README | 2 +- cpuset.spec | 2 +- cpuset/commands/proc.py | 5 ++++- cpuset/version.py | 2 +- cset.init.d | 16 ++++++++-------- doc/cset-proc.1 | 6 +++--- doc/cset-proc.html | 6 +++--- doc/cset-proc.txt | 4 ++-- doc/cset-set.1 | 6 +++--- doc/cset-set.html | 6 +++--- doc/cset-set.txt | 4 ++-- doc/cset-shield.1 | 6 +++--- doc/cset-shield.html | 6 +++--- doc/cset-shield.txt | 4 ++-- doc/cset.1 | 6 +++--- doc/cset.html | 6 +++--- doc/cset.txt | 4 ++-- doc/tutorial.html | 4 ++-- doc/tutorial.txt | 2 +- 21 files changed, 62 insertions(+), 48 deletions(-) diff --git a/INSTALL b/INSTALL index 01a5bcf..1363a06 100644 --- a/INSTALL +++ b/INSTALL @@ -26,6 +26,6 @@ For more information: Prebuild Binary Packages ======================== Alternatively, you may download pre-built binary packages for multiple -distributions from the OpenSUSE Build Service here: +distributions from the Open Build Service here: http://download.opensuse.org/repositories/home:/tsariounov:/cpuset diff --git a/NEWS b/NEWS index 65857a0..7c3f638 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,14 @@ +============================================================ +Cpuset 1.5.6 (June 9, 2011) +http://code.google.com/p/cpuset +http://download.opensuse.org/repositories/home:/tsariounov:/cpuset/ + +Maintenance update to 1.5.5 includes fixes as follows. + +* Fix for Issue#5: LOGNAME environment variable set incorrectly... + Set LOGNAME and USERNAME env variables when execing new process + to match --user option, if given. + ============================================================ Cpuset 1.5.5 (August 3, 2010) http://code.google.com/p/cpuset diff --git a/README b/README index 2711eaf..4ca4f8e 100644 --- a/README +++ b/README @@ -15,7 +15,7 @@ Bugs or feature requests should be sent to: ----- -Copyright (C) 2008-2010 Novell Inc. +Copyright (C) 2008-2011 Novell Inc. Author: Alex Tsariounov diff --git a/cpuset.spec b/cpuset.spec index 2c83474..86c8388 100644 --- a/cpuset.spec +++ b/cpuset.spec @@ -16,7 +16,7 @@ # norootforbuild Name: cpuset -Version: 1.5.5 +Version: 1.5.6 Release: 1 License: GPL v2 only BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/cpuset/commands/proc.py b/cpuset/commands/proc.py index 41a246d..353292f 100644 --- a/cpuset/commands/proc.py +++ b/cpuset/commands/proc.py @@ -565,7 +565,10 @@ def run(tset, args, usr_par=None, grp_par=None): s.path, os.getpid()) # change user and group before exec if grp_par: os.setgid(group) - if usr_par: os.setuid(user) + if usr_par: + os.setuid(user) + os.environ["LOGNAME"] = usr_par + os.environ["USERNAME"] = usr_par os.execvp(args[0], args) def is_unbound(proc): diff --git a/cpuset/version.py b/cpuset/version.py index 8078766..9b20cfc 100644 --- a/cpuset/version.py +++ b/cpuset/version.py @@ -16,4 +16,4 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -version = '1.5.5' +version = '1.5.6' diff --git a/cset.init.d b/cset.init.d index 76c838c..b42a529 100755 --- a/cset.init.d +++ b/cset.init.d @@ -51,12 +51,12 @@ test -x $CSET_BIN || { echo "$CSET_BIN not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } -# cset variables +# cset variables (EDIT apropriately for your situation) CSET_SYSTEM=0 CSET_USER=1-7 -# Check for existence of needed config file and read it -# This is not used for this example, but you can create one for +# Check for existence of cset config file and read it +# This is not used in this example, but you can create one for # your setup if you wish. #CSET_CONFIG=/etc/sysconfig/cset #test -r $CSET_CONFIG || { echo "$CSET_CONFIG not existing"; @@ -86,16 +86,16 @@ case "$1" in #### Example 1: using the shield subcommand ## - #$CSET_BIN shield --cpu=0 + #$CSET_BIN shield --cpu=1-3 # Note that this creates CPU 0 as the general processor that runs - # everything and all other CPUs are assigned to the shield. This - # is a typical simple shielding setup. Adjust if your needs are - # different. + # everything and all other CPUs (assuming this is a 4-CPU system) are assigned + # to the shield. This is a typical simple shielding setup. Adjust if your + # needs are different. # For shielding kernel threads as well, use the -k switch below instead # of the shield command above. - #$CSET_BIN shield --cpu=0 -k + #$CSET_BIN shield --cpu=1-3 -k ## #### Example 2: using the set and proc subcommands diff --git a/doc/cset-proc.1 b/doc/cset-proc.1 index 320a985..10a6bbf 100644 --- a/doc/cset-proc.1 +++ b/doc/cset-proc.1 @@ -2,12 +2,12 @@ .\" Title: cset-proc .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 02/11/2010 +.\" Date: 06/09/2011 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" -.TH "CSET\-PROC" "1" "02/11/2010" "[FIXME: source]" "[FIXME: manual]" +.TH "CSET\-PROC" "1" "06/09/2011" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -258,7 +258,7 @@ You do not have to worry about where in the Linux filesystem the cpuset filesyst .SH "LICENSE" Cpuset is licensed under the GNU GPL V2 only\&. .SH "COPYRIGHT" -Copyright (c) 2008\-2010 Novell Inc\&. +Copyright (c) 2008\-2011 Novell Inc\&. .SH "AUTHOR" Written by Alex Tsariounov \&. .SH "SEE ALSO" diff --git a/doc/cset-proc.html b/doc/cset-proc.html index a8c4720..b0d3d18 100644 --- a/doc/cset-proc.html +++ b/doc/cset-proc.html @@ -685,7 +685,7 @@ respect to the root of the cpuset filesystem.

-

Copyright (c) 2008-2010 Novell Inc.

+

Copyright (c) 2008-2011 Novell Inc.

AUTHOR

@@ -700,8 +700,8 @@ respect to the root of the cpuset filesystem.

diff --git a/doc/cset-proc.txt b/doc/cset-proc.txt index 280fbc0..d363f92 100644 --- a/doc/cset-proc.txt +++ b/doc/cset-proc.txt @@ -1,7 +1,7 @@ cset-proc(1) ============ Alex Tsariounov -v1.5.3, February 2010 +v1.5.6, June 2011 NAME ---- @@ -207,7 +207,7 @@ Cpuset is licensed under the GNU GPL V2 only. COPYRIGHT --------- -Copyright (c) 2008-2010 Novell Inc. +Copyright (c) 2008-2011 Novell Inc. AUTHOR ------ diff --git a/doc/cset-set.1 b/doc/cset-set.1 index a59fc45..79741e1 100644 --- a/doc/cset-set.1 +++ b/doc/cset-set.1 @@ -2,12 +2,12 @@ .\" Title: cset-set .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 02/11/2010 +.\" Date: 06/09/2011 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" -.TH "CSET\-SET" "1" "02/11/2010" "[FIXME: source]" "[FIXME: manual]" +.TH "CSET\-SET" "1" "06/09/2011" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -125,7 +125,7 @@ The above commands will create the new cpusets, or if they already exist, they w .SH "LICENSE" Cpuset is licensed under the GNU GPL V2 only\&. .SH "COPYRIGHT" -Copyright (c) 2008\-2010 Novell Inc\&. +Copyright (c) 2008\-2011 Novell Inc\&. .SH "AUTHOR" Written by Alex Tsariounov \&. .SH "SEE ALSO" diff --git a/doc/cset-set.html b/doc/cset-set.html index e413afa..b6897d3 100644 --- a/doc/cset-set.html +++ b/doc/cset-set.html @@ -614,7 +614,7 @@ already exist, they will modify them to the new specifications.

-

Copyright (c) 2008-2010 Novell Inc.

+

Copyright (c) 2008-2011 Novell Inc.

AUTHOR

@@ -629,8 +629,8 @@ already exist, they will modify them to the new specifications.

diff --git a/doc/cset-set.txt b/doc/cset-set.txt index 6161fe1..62d13e4 100644 --- a/doc/cset-set.txt +++ b/doc/cset-set.txt @@ -1,7 +1,7 @@ cset-set(1) =========== Alex Tsariounov -v1.5.3, February 2010 +v1.5.6, June 2011 NAME ---- @@ -156,7 +156,7 @@ Cpuset is licensed under the GNU GPL V2 only. COPYRIGHT --------- -Copyright (c) 2008-2010 Novell Inc. +Copyright (c) 2008-2011 Novell Inc. AUTHOR ------ diff --git a/doc/cset-shield.1 b/doc/cset-shield.1 index 2a5c1af..85901f5 100644 --- a/doc/cset-shield.1 +++ b/doc/cset-shield.1 @@ -2,12 +2,12 @@ .\" Title: cset-shield .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 02/11/2010 +.\" Date: 06/09/2011 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" -.TH "CSET\-SHIELD" "1" "02/11/2010" "[FIXME: source]" "[FIXME: manual]" +.TH "CSET\-SHIELD" "1" "06/09/2011" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -241,7 +241,7 @@ Even though you can mix general usage of cpusets with the shielding concepts des .SH "LICENSE" Cpuset is licensed under the GNU GPL V2 only\&. .SH "COPYRIGHT" -Copyright (c) 2008\-2010 Novell Inc\&. +Copyright (c) 2008\-2011 Novell Inc\&. .SH "AUTHOR" Written by Alex Tsariounov \&. .SH "SEE ALSO" diff --git a/doc/cset-shield.html b/doc/cset-shield.html index 16e3402..93e799a 100644 --- a/doc/cset-shield.html +++ b/doc/cset-shield.html @@ -706,7 +706,7 @@ and proc) directly.
-

Copyright (c) 2008-2010 Novell Inc.

+

Copyright (c) 2008-2011 Novell Inc.

AUTHOR

@@ -721,8 +721,8 @@ and proc) directly.
diff --git a/doc/cset-shield.txt b/doc/cset-shield.txt index 5b74196..d2e75b1 100644 --- a/doc/cset-shield.txt +++ b/doc/cset-shield.txt @@ -1,7 +1,7 @@ cset-shield(1) ============== Alex Tsariounov -v1.5.3, February 2010 +v1.5.6, June 2011 NAME ---- @@ -230,7 +230,7 @@ Cpuset is licensed under the GNU GPL V2 only. COPYRIGHT --------- -Copyright (c) 2008-2010 Novell Inc. +Copyright (c) 2008-2011 Novell Inc. AUTHOR ------ diff --git a/doc/cset.1 b/doc/cset.1 index ee8c414..69070c5 100644 --- a/doc/cset.1 +++ b/doc/cset.1 @@ -2,12 +2,12 @@ .\" Title: cset .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 02/11/2010 +.\" Date: 06/09/2011 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" -.TH "CSET" "1" "02/11/2010" "[FIXME: source]" "[FIXME: manual]" +.TH "CSET" "1" "06/09/2011" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -135,7 +135,7 @@ Specify the mountpoint where the cpuset filesystem is to be mounted\&. By defaul .SH "LICENSE" Cpuset is licensed under the GNU GPL V2 only\&. .SH "COPYRIGHT" -Copyright (c) 2008\-2010 Novell Inc\&. +Copyright (c) 2008\-2011 Novell Inc\&. .SH "AUTHOR" Written by Alex Tsariounov diff --git a/doc/cset.html b/doc/cset.html index 643a5a4..75925c9 100644 --- a/doc/cset.html +++ b/doc/cset.html @@ -634,7 +634,7 @@ mountpoint = <directory_name>
-

Copyright (c) 2008-2010 Novell Inc.

+

Copyright (c) 2008-2011 Novell Inc.

AUTHOR

@@ -653,8 +653,8 @@ http://www.procode.org/stgit). Stacked GIT is under GPL V2 or later.

diff --git a/doc/cset.txt b/doc/cset.txt index dc335cb..29a6ffc 100644 --- a/doc/cset.txt +++ b/doc/cset.txt @@ -1,7 +1,7 @@ cset(1) ====== Alex Tsariounov -v1.5.3, December 2010 +v1.5.6, June 2011 NAME ---- @@ -139,7 +139,7 @@ Cpuset is licensed under the GNU GPL V2 only. COPYRIGHT --------- -Copyright (c) 2008-2010 Novell Inc. +Copyright (c) 2008-2011 Novell Inc. AUTHOR ------ diff --git a/doc/tutorial.html b/doc/tutorial.html index 53a3988..0f145c5 100644 --- a/doc/tutorial.html +++ b/doc/tutorial.html @@ -467,7 +467,7 @@ function generateToc(toclevels) {

Alex Tsariounov <alext@novell.com>
-Copyright (c) 2009-2010 Novell Inc., cset v1.5.3
+Copyright (c) 2009-2011 Novell Inc., cset v1.5.6
Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice is preserved.

This tutorial describes basic and advanced usage of the cset command to @@ -1802,7 +1802,7 @@ Please attach this file to the bug.

diff --git a/doc/tutorial.txt b/doc/tutorial.txt index 7f0b62a..9ba057b 100644 --- a/doc/tutorial.txt +++ b/doc/tutorial.txt @@ -2,7 +2,7 @@ Cpuset (cset) Tutorial ###################### Alex Tsariounov + -Copyright (c) 2009-2010 Novell Inc., cset v1.5.3 + +Copyright (c) 2009-2011 Novell Inc., cset v1.5.6 + Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice is preserved.