All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trevor Woerner <twoerner@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: Re: [meta-browser][PATCH 2/3] chromium: update run script for early run
Date: Wed, 6 Jan 2016 09:44:35 -0500	[thread overview]
Message-ID: <568D2853.2010702@gmail.com> (raw)
In-Reply-To: <n6j027$8ma$1@ger.gmane.org>

On 01/06/16 07:07, Koen Kooi wrote:
> Op 05-01-16 om 22:15 schreef Trevor Woerner:
> > If the chromium run-helper script (google-chrome) is run as part of a
> > (sysvinit) init script, shell variables $USER and $HOME will not be set
> > (leading to unwanted behaviour).
>
> > Replace the use of $USER with `whoami` and replace the use of $HOME with
> > the OE bitbake variable ROOT_HOME.
>
> > In this way the chromium run-helper script will work as expected in
> both
> > instances (as part of an init script and from the cmdline).
>
> Doesn't this break running chrome as a regular non-root user?

I haven't tested that, but on inspection it doesn't. I'm not changing
the _behaviour_ of the /usr/bin/google-chrome script, I'm only changing
the tools it uses to do what it's already doing.

The /bin/sh script has an "if" clause looking to see if the person
running it is root, if so it adds an extra parameter
(--user-data-dir=...) to the invocation of the actual
/usr/bin/chromium/chrome binary.

Prior to this patch the script was using $USER and $HOME and I've simply
changed those to be `whoami` and at build time changing a placeholder
from ROOT_HOME to whatever you've defined in your OE environment to be
the root user's home.

Basically I'm building a kiosk and I want chrome to start automatically
(via a sysvinit script) on startup. When /usr/bin/google-chrome is
invoked as part of a sysvinit script I have found that neither $USER nor
$HOME are defined, so this clause (which is needed in my case) isn't
invoked.


  reply	other threads:[~2016-01-06 14:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05 21:15 [meta-browser][PATCH 1/3] chromium_40.0.2214.91: API keys update Trevor Woerner
2016-01-05 21:15 ` [meta-browser][PATCH 2/3] chromium: update run script for early run Trevor Woerner
2016-01-06 12:07   ` Koen Kooi
2016-01-06 14:44     ` Trevor Woerner [this message]
2016-01-05 21:15 ` [meta-browser][PATCH 3/3] chromium: add kiosk-mode PACKAGECONFIG Trevor Woerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=568D2853.2010702@gmail.com \
    --to=twoerner@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.