Allow the system adminstrator to provide options to the login
program. Some changes for several layouts of the agetty
prompt like short host name or full qualified host name.
Four options enables the user to delay agetty after start,
to change the working directory, to change the root directory,
and to modified scheduling priority.
Signed-off-by: Werner Fink <werner@suse.de>
Add an autologin feature to agetty, that is that a user can be
automatically logged in. For this the options of for the
login program has to used. Make it possible to pass-through
options to the login program which requires a security check.
Signed-off-by: Werner Fink <werner@suse.de>
Better support of virtual console due support of UTF-8 login names
provided by e.g. LDAP. Set default size 24/80 on serial modem lines
if not found by the kernel.
Signed-off-by: Werner Fink <werner@suse.de>
Check out a virtual console line for UTF-8 support, also skip
modem specific setups on a virtual console line.
Signed-off-by: Werner Fink <werner@suse.de>
Ensure a proper session on the terminal line, that is do a
vhangup() and become the controlling terminal. After this
determine if the terminal line a virtual console by using
the ioctl TIOCMGET to get the status modem bits of a serial
line which is a invalid argument on a virtual console.
Signed-off-by: Werner Fink <werner@suse.de>
Next cleanup, that is split off special character parsing in do_prompt()
and parse_args(), handle name of line of virtual console and use it in
utmp update as well as the session id. Also move the initial TERM
variable to open_tty() as we use this later in open_tty(). Use writeall()
but avoid repeat to often for EAGAIN (compare with info page of the
(g)libc, description of the macro EAGAIN).
Signed-off-by: Werner Fink <werner@suse.de>
More code cleanup, that is use bit mask for eight bit option, use
modern speed_t type, split local error() into local log_err(), log_warn(),
and dolog() for fine graduated logging with syslogger.
Signed-off-by: Werner Fink <werner@suse.de>
When looking for a volume label on a FAT32 filesystem, blkid does not
correctly handle special cluster values in the range 0x0FFFFFF8 to
0x0FFFFFFF, which mark the last cluster in a chain. As a result, it
begins to read [what it treats as] FAT entries from past the end of the
FAT. Depending on the data read, it may then try to parse random data
from the filesystem (including user files, free space, and other
directories) as though it were part of the root directory.
Because parsing stops early when a volume label is found, the problem
only occurs on filesystems without a volume label. When it occurs, it
may result in a long sequence of lseek and read calls; on an older IDE
drive with a 2 GB FAT32 partition, this amounted to around 3 seconds of
disk I/O.
After patching, blkid stop parsing as soon as it reaches a cluster value
greater than or equal to the number of entries in the FAT.
[kzak@redhat.com: - add le32_to_cpu()]
Signed-off-by: John Lindgren <john.lindgren@tds.net>
Add a new '-a' option to view/modify the CPU affinity for an entire
group of threads belonging to a given PID. We create two new
functions, print_affinity() and do_taskset() for code simplification.
Example:
zeus@jilguero:~/src/util-linux/schedutils$ ./taskset -a -p 01 3142
pid 3142's current affinity mask: 2
pid 3142's new affinity mask: 1
pid 3164's current affinity mask: 2
pid 3164's new affinity mask: 1
pid 854's current affinity mask: 2
pid 854's new affinity mask: 1
[kzak@redhat.com: - clean up
- move variables to struct taskset]
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Tested-by: Jonathan Gonzalez <zeus@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
The default response is 'p' until three primary partitions are created,
then 'e'.
The original idea is from Karel Zak.
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Mainly this appends a colon for the prompt, reverses order of the list,
reports the number of primary partitions used and unused.
Old version:
Command action
e extended
p primary partition (1-4)
p
New version:
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select: p
Old version:
Command action
l logical (5 or over)
p primary partition (1-4)
l
New version:
Partition type:
p primary (0 primary, 1 extended, 3 free)
l logical (numbered from 5)
Select: l
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
... usable in scripts, for example:
findmnt --pairs -o "SOURCE,TARGET,FSTYPE" $1 | while read line; do
eval $line
echo "$SOURCE is mounted on $TARGET [$FSTYPE]"
done
Signed-off-by: Karel Zak <kzak@redhat.com>
Make sfdisk(8) return non-zero value on failed BLKRRPART ioctl().
This will happen for either partition table re-reads after partition
changes or on explicit use of -R switch.
The function reread_disk_partition() was changed from 'void' to 'int'
and now returns a result to let the calling functions decide to exit(1).
Signed-off-by: Andrea Galbusera <gizero@gmail.com>
Currently this program works only with the master thread. Add a '-t'
option to propagate changes to the entire group of threads.
Example:
root@offworld:~/projects/util-linux/schedutils# ls /proc/2111/task/
2111 2112 2119 2121 2138 2139 2159 2160
root@offworld:~/projects/util-linux/schedutils# ./chrt -p 2111
pid 2111's current scheduling policy: SCHED_RR
pid 2111's current scheduling priority: 3
root@offworld:~/projects/util-linux/schedutils# ./chrt -t -p 2 2111
root@offworld:~/projects/util-linux/schedutils# ./chrt -p 2112
pid 2112's current scheduling policy: SCHED_RR
pid 2112's current scheduling priority: 2
root@offworld:~/projects/util-linux/schedutils# ./chrt -p 2111
pid 2111's current scheduling policy: SCHED_RR
pid 2111's current scheduling priority: 2
[kzak@redhat.com: - rename -t/--thread to -a/--all-tasks]
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>