From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 7 15:16:02 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6827106566B; Thu, 7 Jun 2012 15:16:02 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5C80D8FC1E; Thu, 7 Jun 2012 15:16:02 +0000 (UTC) Received: by yenl8 with SMTP id l8so555215yen.13 for ; Thu, 07 Jun 2012 08:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=VFBApbuAXKHlhMyN/eI9AUt+ln3xYtMqnDDD/JD4olQ=; b=AZoWbAYHcgJKb6ul99vBJMXCEok7fc9aKx2gz1pNNM3ts1ReEh7+4ytfQ1Sz3P64cD LbmSmmpaMhtW2hXfOEeGDCImZ7KpePKm97lZjG00D9NCYiVRpUPZEQctFFKOfYm9Lrav iBH5yTwIVrxNxGElYSJ3OIelbdAsqMUEhEMb1cTBUTpoem48SMigLONzVQTIxwQhVW2f UzCqN6aLsV54lqRHHlbPWbwJPVkCEHHOKCRJl4TH7mGBZeUnq423TxPSpT5gZymf0rAV ti9elR7XdpSmWeJ+2fPzeHBdmIr8rXrzxD6IiEvxa+QRmwoBZEYKGZF5V+vSvEAscLbW KKHw== MIME-Version: 1.0 Received: by 10.60.14.193 with SMTP id r1mr2556330oec.16.1339082160841; Thu, 07 Jun 2012 08:16:00 -0700 (PDT) Received: by 10.76.98.77 with HTTP; Thu, 7 Jun 2012 08:16:00 -0700 (PDT) In-Reply-To: <20120607095741.GA1361@reks> References: <4FD05C16.9040905@FreeBSD.org> <20120607084738.GT85127@deviant.kiev.zoral.com.ua> <4FD06CD3.3080602@FreeBSD.org> <20120607095741.GA1361@reks> Date: Thu, 7 Jun 2012 08:16:00 -0700 Message-ID: From: Garrett Cooper To: Gleb Kurtsou Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Konstantin Belousov , freebsd-hackers@freebsd.org, Andriy Gapon Subject: Re: boot menu option to disable graphics mode X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 15:16:02 -0000 On Thu, Jun 7, 2012 at 2:57 AM, Gleb Kurtsou wrote= : > On (07/06/2012 11:56), Andriy Gapon wrote: >> on 07/06/2012 11:47 Konstantin Belousov said the following: >> > On Thu, Jun 07, 2012 at 10:45:26AM +0300, Andriy Gapon wrote: >> >> >> >> It's long been a wish of mine to have an ability to decide at boot ti= me that a >> >> system should boot in "console-only" mode. =A0That is, that no graphi= cs/X >> >> applications like e.g. xdm/kdm/gdm are automatically started even whe= n they are >> >> configured to do so. >> >> >> >> Here is my attempt at implementing that: >> >> https://gitorious.org/~avg/freebsd/avgbsd/commit/96f7051d63d4286ef6f0= 196d241e7855338a6ed7?format=3Dpatch >> >> >> >> All the option does at boot time is setting of 'inhibit_gui' variable= for kernel >> >> environment. =A0I envision that this variable could be properly and g= racefully >> >> handled in various startup scripts and/or application startup logic. >> >> But to ensure that the option is always honored I've also added "ulti= mate >> >> protection" to syscons that prohibits KDSETMODE/KD_GRAPHICS ioctl. >> > This is too much, IMO. I understand why you may want to disable >> > auto-start of login manager, but preventing a user from running X at a= ll >> > until she learns about kenv -u _and_ obscure code somewhere in the ker= nel, >> > is unreasonable. >> >> A user doesn't have to select the option unless he needs to. >> A "simple user" can just reboot without selecting the option to get back= his X. >> A user doesn't have to learn anything about the code, just about kenv an= d >> "magic" inhibit_gui variable. > > What do you think about adding generic support for overriding *_enable > options in rc.conf? > > I'd like to be able to disable services at boot prompt, e.g. > # set rc.slim_enable=3D"no" -- overrides slim_enable=3D"yes" in rc.conf > > Similarly rc.pf_enable=3D"no" > > Then introduce x_enable knob (=3Dyes by default) to disable login > managers. User will be able to override this setting with > # service xdm forcestart It needs to be profiled, but I would be curious what the slowdown would be for this change. Also, it sort of introduces a fun chicken and egg problem with sourcing rc.conf files, like I discovered recently at $JOB. Thanks, -Garrett