Package: util-linux
Version: 2.19.1-5
Severity: wishlist
File: /usr/bin/ionice

The ionice(2) manual page describes the two syntaxes:

> ionice [[-c class] [-n classdata] [-t]] -p PID [PID]...
> ionice [-c class] [-n classdata] [-t] COMMAND [ARG]...

However, when I use the latter syntax with neither -c nor -n,
ionice misparses it as the former syntax:

% ionice ls
none: prio 0
ionice: failed to parse pid: 'ls'

i.e. it treats the COMMAND argument "ls" as a PID.  This behavior
conflicts with what the manual page says about the -p option:

> If this argument is not given, ionice will run the listed
> program with the given parameters.

According to this description, "ionice ls" should just run the ls
program without changing the I/O priority.  Because this would
not be consistent with "nice ls", it might actually be better to
make ionice report a clear error in this case (e.g. "ionice:
executing a command requires -c or -n") and change the manual
page accordingly.

Likewise, ionice misparses a PID argument as a COMMAND if
preceded by -p 0:

% ionice -c 0 -p 0 $$
ionice: executing 607 failed: No such file or directory

That might be considered not a bug, because 0 is not valid as a
process ID.  However, the iopriv_get system call does support
who==0, so it should perhaps be allowed here too.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fi_FI.utf8, LC_CTYPE=fi_FI.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages util-linux depends on:
ii  debconf [debconf-2.0]  1.5.41          
ii  dpkg                   1.16.1.2        
ii  initscripts            2.88dsf-13.13   
ii  install-info           4.13a.dfsg.1-8  
ii  libblkid1              2.19.1-5        
ii  libc6                  2.13-21         
ii  libncurses5            5.9-4           
ii  libselinux1            2.1.0-4         
ii  libslang2              2.2.4-3         
ii  libuuid1               2.19.1-5        
ii  lsb-base               3.2-28          
ii  tzdata                 2011n-1         
ii  zlib1g                 1:1.2.3.4.dfsg-3

util-linux recommends no packages.

Versions of packages util-linux suggests:
pn  dosfstools          3.0.12-1
pn  kbd                 1.15.3-7
pn  util-linux-locales  <none>  

-- debconf information:
  util-linux/noauto-with-nonzero-passnum:

Attachment: pgp2fcnfTUlgK.pgp
Description: PGP signature

Reply via email to