From owner-freebsd-stable@freebsd.org Sat Jun 23 15:45:40 2018 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2E3010258DB for ; Sat, 23 Jun 2018 15:45:39 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yb0-x230.google.com (mail-yb0-x230.google.com [IPv6:2607:f8b0:4002:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F4A388093 for ; Sat, 23 Jun 2018 15:45:39 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yb0-x230.google.com with SMTP id a2-v6so3053726ybe.11 for ; Sat, 23 Jun 2018 08:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=iO/EAh1E+Si6GTuZtbw5dHoVKJnewrMw2RKzBBsFli0=; b=FimD2RmNVpXpgL/D90IlwqdC+korx4PyoMjClHv5ITkiEBmxh4IDe+PchxQka9vmA1 6Ujs6TVqwHTbugtt9d2x1RH7lH0gdL5e/dHPwxAf/WX1aV38GaOiC+xjz4YGbS3ztu1c tzuL/BcnCa9jM5XOn+FjJZC5s+fnHqjUHu76Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=iO/EAh1E+Si6GTuZtbw5dHoVKJnewrMw2RKzBBsFli0=; b=r8YLIbttbgzIP2lo4Gd6NGnLO/1xuFoxldP6uh7r8j+zmNXX2YA+n3ngNsAP1YwfRV 1F5wUm2JyCaY/1Zx3aI9qY69pigcB9R5Svfym31NA/maHCM1nU3F18YIdDuME3efJhHY avF50y5uFeKJ7QiKQ/cSFy93X8+Oznr+VVxE6+J8tJmFLNIPfVbQQ1iaXQ4+myXw6xy/ jENuxegciCHrpm1c2FH7LRbsxorpW8G3/fB4pGaueCRWZSKlAKjkEg86mYXpv6eZIwT0 S2d0tpz7SZZeWlYT1D5wijDf58bmMYY5w/LKVee5elNoQ5Dmba8jYrcqZGObMhRT6cKF 8LoQ== X-Gm-Message-State: APt69E0w2Ir8YYUCD1k1Vl6zYb9zymqff+XwC7BmFFVjcM3w7rfPVDaV KkcDIVl6DQk1hIjJdpDmWi2jo+F73nRU/yfUZZWhdg== X-Google-Smtp-Source: ADUXVKIMyT1lYPfkwEAkPvKytRbmD5uqQ239YSXvQDsbvN0zqQsA4UZg9D/PN6WFlEUwV1AukOWoR4nbW7o0up8IsOw= X-Received: by 2002:a5b:64c:: with SMTP id o12-v6mr2981316ybq.460.1529768738649; Sat, 23 Jun 2018 08:45:38 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sat, 23 Jun 2018 08:45:08 -0700 (PDT) In-Reply-To: <18000a3b93085c91aeffbca937862786@freebsd.org> References: <6dd9952452c73826a2f9c01612586bea@udns.ultimatedns.net> <18000a3b93085c91aeffbca937862786@freebsd.org> From: Eitan Adler Date: Sat, 23 Jun 2018 08:45:08 -0700 Message-ID: Subject: Re: jail related inconsistencies in FreeBSD tools parameters To: James Gritton Cc: bsd-lists@bsdforge.com, freebsd-jail@freebsd.org, freebsd-stable Stable Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2018 15:45:40 -0000 On 23 June 2018 at 08:30, James Gritton wrote: > On 2018-06-22 16:03, Miroslav Lachman wrote: >> >> Chris H wrote on 2018/06/22 23:46: >>> >>> On Fri, 22 Jun 2018 23:13:17 +0200 "Miroslav Lachman" <000.fbsd@quip.cz> >>> said >>> >>>> I don't know if it is better to discuss it in jail@ or stable@ list so a >>>> do cross-post. >>>> >>>> FreeBSD has many jail aware utilities but they are inconsistent in >>>> taking JID as parameter. >>>> >>>> For example "sockstat" takes -j JID "Show only sockets belonging to the >>>> specified jail ID" and it means numeric ID only. >>>> On the other hand "ps" takes -J JID "This may be either the jid or name >>>> of the jail. Use -J 0 to display only host processes." >>>> The same apply for "top", it understands jid as a number or name of the >>>> jail too. >>>> Then again "cpuset" takes only numerical ID of the jail... >>>> >>>> Shouldn't it be consistent across all FreeBSD base utilities so all of >>>> them can use numerical ID and name? >>> >>> Good idea! Are you offering to create a patch? ;-) >>> It'd be my guess that given they weren't all created at the same time, >>> nor >>> the same individual; that (quite probably?) the "jail" additions were >>> also >>> added at different times, and by different people. So I'd imagine that >>> unless someone with a commit bit decides one day they'd like to take that >>> on. Someone(tm) maybe you? will need to propose a patch. :-) >> >> >> If I can understand C sources I will create the patch by myself >> instead of just posting here. Unfortunately I am able to code in sh, >> php and a bit of javascript and perl but no C. :) >> >> Miroslav Lachman > > > Sure, a PR would be handy for this - it's a pretty simple thing to add, and > consistency would indeed be a good move. Agreed. I'll review and commit such patches. I'd like to see a single function for taking a "id or name". Ideally it would live in a library, perhaps libjail? -- Eitan Adler