From owner-freebsd-hackers@freebsd.org Tue Jun 27 07:20:50 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1538DA3252 for ; Tue, 27 Jun 2017 07:20:50 +0000 (UTC) (envelope-from ap00@mail.ru) Received: from fallback.mail.ru (fallback8.mail.ru [94.100.181.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C29257F220 for ; Tue, 27 Jun 2017 07:20:48 +0000 (UTC) (envelope-from ap00@mail.ru) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Subject:CC:To:Message-ID:From:Date; bh=cLsQ3BwQo6b/JHj35wnTwVjFV/lBXiDPM9DhqdWDKr4=; b=F2pUu3Upq3Y10Zcm+dk4GCXKet1UqEGQCWI7jEdqRtjth1mVNOUX8Jj+bE13dqggQeCqmf/K6bv4aPbBC1Fz38FrdC7b4l0RQPUt/t5iMUJrgIqGoVlZWvtUeM0wpJRTHJ9kMP8Yt+dApfjgVXwhx/AVZUO8fkYeRITYXIXvn/M=; Received: from [10.161.64.45] (port=54280 helo=smtp37.i.mail.ru) by fallback8.mail.ru with esmtp (envelope-from ) id 1dPknj-0006F3-CR for freebsd-hackers@freebsd.org; Tue, 27 Jun 2017 10:20:43 +0300 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Subject:CC:To:Message-ID:From:Date; bh=cLsQ3BwQo6b/JHj35wnTwVjFV/lBXiDPM9DhqdWDKr4=; b=F2pUu3Upq3Y10Zcm+dk4GCXKet1UqEGQCWI7jEdqRtjth1mVNOUX8Jj+bE13dqggQeCqmf/K6bv4aPbBC1Fz38FrdC7b4l0RQPUt/t5iMUJrgIqGoVlZWvtUeM0wpJRTHJ9kMP8Yt+dApfjgVXwhx/AVZUO8fkYeRITYXIXvn/M=; Received: from [91.190.121.202] (port=61310 helo=[192.168.192.10]) by smtp37.i.mail.ru with esmtpa (envelope-from ) id 1dPknb-0002GQ-1T; Tue, 27 Jun 2017 10:20:35 +0300 Date: Tue, 27 Jun 2017 10:20:31 +0300 From: Anthony Pankov X-Priority: 3 (Normal) Message-ID: <1352411842.20170627102031@mail.ru> To: Adrian Chadd CC: "freebsd-hackers@freebsd.org" Subject: Re: using rc.subr only by root restriction In-Reply-To: References: <1599987034.20170623182536@mail.ru> <18210175522.20170626103248@mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-7FA49CB5: 0D63561A33F958A519ABC1F642B74330A9185D9FA6B0F3C101BD826A951F0E80725E5C173C3A84C3727597FF642BA4D7053618308680E96BDD0078234547CCE7C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F8DB212830C5B42F72623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-Mailru-Sender: D8D48EF70163D79D00784CDFC8FD310767EDC35ECECB5BDC3FF4F25420D6A7C38E40771E925BDC5D50D5CF8590B94F4EC77752E0C033A69E81198BD1A48777B793AC9912533B2342AE208404248635DF X-Mras: OK X-Mras: OK X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2017 07:20:50 -0000 >> May be we can agree at "explicit is better than implicit" principle >> and do not apply a login class when ${name}_login_class is not >> declared explicity? >> >> It will solve my problem too. > No, because the whole point of the services at startup was to actally > get the 'daemon' class. That was the intention all along and what > happened to things at startup time. My patch was to bring running > "service" in line with what the system did at startup time. Ok. This was introduced somewhere later then FreeBSD 9.3 and I've missed this. > It sucks - ideally we'd have a service manager that you'd request to > run things on your behalf and it'd always apply a consistent set of > things, like login class. Unfortunately I can't suggest other solution then the proposed patch. The patch introduce an additional logic - service will start not in 'daemon' login class if executed as regular user. But I think this is better then failing with error and eliminating possibility to use rc.subr library in scripts of regular users. May be you'll commit it? -- Anthony