LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Gentoo (https://www.linuxquestions.org/questions/gentoo-87/)
-   -   What's the group of init? (https://www.linuxquestions.org/questions/gentoo-87/whats-the-group-of-init-911710/)

smag 11-03-2011 01:21 PM

What's the group of init?
 
I start my X server from my /etc/inittab. Now I want to start the X server with the Gid and Uid of my ordinary user. So which is the group and uid of Init?

MensaWater 11-03-2011 01:41 PM

I'm not sure what you mean by that.

To see the user and group init is running as you can type:
ps -eo cmd,user,group |grep init
This shows the command, user and group for processes and the grep limits output to init. You should see something like:
init [5] root root
So init is running as user root and group root. You could use uid,gid instead of user,group if you want the numeric values from /etc/passwd (user) and /etc/group (group) instead of the names.

init is the parent process of all other processes on the system. It can NOT be started manually or killed and you should not muck with how it starts.

Typically what is running in inittab is run as root so you'd have to modify the the "command" portion of the inittab entry to have an "su - <user> -c" in front of a command (or have it in a script and use that as the command). However, I don't know that you can run X Windows itself as a non-root user. Note that even though X Windows is being started by root user it doesn't grant access - you still have to login to the X login screen as either the root or the non-root user of your choice. Why do you think you need to change it to a non-root user?

smag 11-03-2011 02:04 PM

Thanks for the reply.
This is the entry of my inittab:
Quote:

c8:3: once:sudo -u smag -g smag startx
I start my X server with startx. I don't what to use the root user but my ordinary one. So I modified my sudoers file like that:
Quote:

root ALL=(myuser:mygroupuser) startx
but it didn't work. So I'm wondering why it dosen't work.

smag 11-04-2011 03:15 PM

I changed:
Quote:

sudo -u smag -g smag startx
to:
Quote:

su smag -c startx
And now it works fine.
Thanks for the reply.

MensaWater 11-04-2011 03:32 PM

Glad you got it going.

Please go to Thread Tools at the top of the page and mark this as "solved". It makes it easier for others to find it when doing web searches later.

smag 11-04-2011 04:59 PM

Quote:

Originally Posted by MensaWater (Post 4516022)
Glad you got it going.

Please go to Thread Tools at the top of the page and mark this as "solved". It makes it easier for others to find it when doing web searches later.

Yeah, sorry.


All times are GMT -5. The time now is 12:12 AM.