chpst.8.txt (3810B) download
1@man chpst 8 "MAY 2023" "%VERSION%" "fiss man page"
2@header chpst(8) %VERSION%
3
4@title name Name
5
6*chpst* - runs a program with a changed process state
7
8
9@title synopsis Synopsis
10
11*chpst* [*-vP012*] [*-u* user] [*-U* user] [*-b* argv0] [*-e* dir] [*-/* root] [*-n* inc] [*-l*|*-L* lock] [*-m* bytes] [*-d* bytes] [*-o* n] [*-p* n] [*-f* bytes] [*-c* bytes] prog [arguments...]
12
13
14@title description Description
15@list
16*-u [:]user[:group]*~
17setuidgid. Set uid and gid to the user's uid and gid, as found in /etc/passwd. If user is followed by a colon and a group, set the gid to group's gid, as found in /etc/group, instead of user's gid. If group consists of a colon-separated list of group names, chpst sets the group ids of all listed groups. If user is prefixed with a colon, the user and all group arguments are interpreted as uid and gids respectivly, and not looked up in the password or group file. All initial supplementary groups are removed.
18
19*-U [:]user[:group]*~
20envuidgid. Set the environment variables $UID and $GID to the user's uid and gid, as found in /etc/passwd. If user is followed by a colon and a group, set $GID to the group's gid, as found in /etc/group, instead of user's gid. If user is prefixed with a colon, the user and group arguments are interpreted as uid and gid respectivly, and not looked up in the password or group file.
21
22*-b argv0*~
23Run prog with argv0 as the 0th argument.
24
25*-/ root*~
26Change the root directory to root before starting prog.
27
28*-C pwd*~
29Change the working directory to pwd before starting prog. When combined with -/, the working directory is changed after the chroot.
30
31*-n inc*~
32Add inc to the nice(2) value before starting prog. inc must be an integer, and may start with a minus or plus.
33
34*-l lock*~
35Open the file lock for writing, and obtain an exclusive lock on it. lock will be created if it does not exist. If lock is locked by another process, wait until a new lock can be obtained.
36
37*-L lock*~
38The same as -l, but fail immediately if lock is locked by another process.
39
40*-P*~
41Run prog in a new process group.
42
43*-0*~
44Close standard input before starting prog.
45
46*-1*~
47Close standard output before starting prog.
48
49*-2*~
50Close standard error before starting prog.
51@endlist
52
53
54@title not-implemented Not Implemented
55
56Following options are defined in runit's chpst but are ignored by fiss' implementation.
57
58@list
59*-e dir*~
60Set various environment variables as specified by files in the directory dir: If dir contains a file named k whose first line is v, chpst removes the environment variable k if it exists, and then adds the environment variable k with the value v. The name k must not contain =. Spaces and tabs at the end of v are removed, and nulls in v are changed to newlines. If
61the file k is empty (0 bytes long), chpst removes the environment variable k if it exists, without adding a new variable.
62
63*-m bytes*~
64Limit the data segment, stack segment, locked physical pages, and total of all segment per process to bytes bytes each.
65
66*-d bytes*~
67limit data segment. Limit the data segment per process to bytes bytes.
68
69*-o n*~
70Limit the number of open file descriptors per process to n.
71
72*-p n*~
73Limit the number of processes per uid to n.
74
75*-f bytes*~
76Limit the output file size to bytes bytes.
77
78*-c bytes*~
79Limit the core file size to bytes bytes.
80
81*-v*~
82Print verbose messages to standard error. This includes warnings about limits unsupported by the system.
83@endlist
84
85@title exit-codes Exit Codes
86
87chpst exits 100 when called with wrong options. It prints an error message and exits 111 if it has trouble changing the process state. Otherwise its exit code is the same as that of prog.
88
89
90@title author Author
91
92Based on the implementation by Gerrit Pape <pape@smarden.org>,
93rewritten by Friedel Schon <derfriedmundschoen@gmail.com>