Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to add groups to a service started by init.rc
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
DanM  
View profile  
 More options May 2 2012, 2:58 pm
From: DanM <murpd...@gmail.com>
Date: Wed, 2 May 2012 11:58:53 -0700 (PDT)
Local: Wed, May 2 2012 2:58 pm
Subject: How to add groups to a service started by init.rc

I want to be able to add a group to a service that is launched via stock
Android init.rc in the system/core directory (specifically rild).

Now I don't want to touch/modify the init.rc file that comes in stock
Android.  But would rather add the group as needed later on
during init.

Now I know that this should be done somewhere in the init.<platform>.rc
file but I cannot seem to find the syntax that allows this.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Glenn Kasten  
View profile  
 More options May 3 2012, 1:31 pm
From: Glenn Kasten <gkas...@android.com>
Date: Thu, 3 May 2012 10:31:38 -0700 (PDT)
Local: Thurs, May 3 2012 1:31 pm
Subject: Re: How to add groups to a service started by init.rc

Given that you don't want to modify system/core/rootdir/init.rc, I guess
you could either (a) define TARGET_PROVIDES_INIT_RC
(see system/core/rootdir/Android.mk for usage) and provide your forked copy
that has the change you want, or (b) run a little edit script inside of
that Android.mk during the copy process, that merges the stock init.rc and
your patch at build time, so that it copies a patched version during that
build step. I don't know of a way to merge the stock init.rc and your patch
at runtime in init, again using the stock init.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
DanM  
View profile  
 More options May 3 2012, 2:17 pm
From: DanM <murpd...@gmail.com>
Date: Thu, 3 May 2012 11:17:54 -0700 (PDT)
Local: Thurs, May 3 2012 2:17 pm
Subject: Re: How to add groups to a service started by init.rc

Thanks Glenn

Yeah I don't want to carry a copy of init.rc for a 2 LOC change.

I would really like to know if there was a way I could add a group to a
service initialized by the init.rc in my platform.rc.

Something similar to chmod or chowm for kernel sysfs.  Have something like
a init directive i.e. addgroup <service name> <group>.  So vendors can
append groups to services
during service instantiation but not have to modify the base init.rc or
carry a copy of it.

Now I am not sure what the security implications of this is.

Dan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Glenn Kasten  
View profile  
 More options May 4 2012, 10:28 am
From: Glenn Kasten <gkas...@android.com>
Date: Fri, 4 May 2012 07:28:59 -0700 (PDT)
Local: Fri, May 4 2012 10:28 am
Subject: Re: How to add groups to a service started by init.rc
init can only do what the kernel supports, and in this case that's
setgroups(2) at http://linux.die.net/man/2/setgroups
init runs as root, then when it needs to create service, forks a child
(which is still root) and the child then executes setuid() and
setgroups() etc. before execing the service.
It sounds like you're looking for a setgroups() which takes a pid
parameter to specify the target process, rather than current process.
I'm not aware of such an API.  I think you're best bet is to arrange
that init creates the service initially with the right groups, using
one of the methods discussed earlier.

On May 3, 11:17 am, DanM <murpd...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »