Verify group of process was set correctly when launched

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I am setting the group of a process when I launch it by doing the following:
sudo -g offline "/home/natral/apps/some-app/bin/app.sh" %f
after the process is running how can I verify the name of the user and group it is running as? I checked ps aux and this would tell me the user but not the group. Then I tried ps -eo uid,gid,args and managed to find the GID but how can I verify that the GID is indeed the group "offline"?
linux permissions group
add a comment |Â
up vote
0
down vote
favorite
I am setting the group of a process when I launch it by doing the following:
sudo -g offline "/home/natral/apps/some-app/bin/app.sh" %f
after the process is running how can I verify the name of the user and group it is running as? I checked ps aux and this would tell me the user but not the group. Then I tried ps -eo uid,gid,args and managed to find the GID but how can I verify that the GID is indeed the group "offline"?
linux permissions group
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am setting the group of a process when I launch it by doing the following:
sudo -g offline "/home/natral/apps/some-app/bin/app.sh" %f
after the process is running how can I verify the name of the user and group it is running as? I checked ps aux and this would tell me the user but not the group. Then I tried ps -eo uid,gid,args and managed to find the GID but how can I verify that the GID is indeed the group "offline"?
linux permissions group
I am setting the group of a process when I launch it by doing the following:
sudo -g offline "/home/natral/apps/some-app/bin/app.sh" %f
after the process is running how can I verify the name of the user and group it is running as? I checked ps aux and this would tell me the user but not the group. Then I tried ps -eo uid,gid,args and managed to find the GID but how can I verify that the GID is indeed the group "offline"?
linux permissions group
asked Dec 7 '17 at 21:13
natral
80113
80113
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
You can use user and group in place of uid and gid to have ps show you the group and user names instead of the numbers. And of course, if you have the process id, you don't need to browse the whole list ps -e gives you, but could just use something like this
$ ps -o pid,user,group,args -p "$pid"
or if you don't have the PID, pgrep could find it for you:
$ÃÂ ps -o pid,user,group,args -p $(pgrep -f app.sh)
But I do suspect sudo would give an error if it couldn't set the group id to the one you want.
add a comment |Â
up vote
2
down vote
If you have the GID value, getent group $GID will give you back all details regarding group whose id is $ID including its name.
Alternatively you can also do getent group offline and see if the number you get back is the one you see in ps output.
I get a result saying offline:x:1003: what does the x mean here?
â natral
Dec 7 '17 at 21:30
It is a placeholder (for the group password, like user have passwords, groups can have too, but AFAIK this feature is nowhere used nowadays), so as long as you get a reply you are fine.
â Patrick Mevzek
Dec 7 '17 at 21:32
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You can use user and group in place of uid and gid to have ps show you the group and user names instead of the numbers. And of course, if you have the process id, you don't need to browse the whole list ps -e gives you, but could just use something like this
$ ps -o pid,user,group,args -p "$pid"
or if you don't have the PID, pgrep could find it for you:
$ÃÂ ps -o pid,user,group,args -p $(pgrep -f app.sh)
But I do suspect sudo would give an error if it couldn't set the group id to the one you want.
add a comment |Â
up vote
1
down vote
accepted
You can use user and group in place of uid and gid to have ps show you the group and user names instead of the numbers. And of course, if you have the process id, you don't need to browse the whole list ps -e gives you, but could just use something like this
$ ps -o pid,user,group,args -p "$pid"
or if you don't have the PID, pgrep could find it for you:
$ÃÂ ps -o pid,user,group,args -p $(pgrep -f app.sh)
But I do suspect sudo would give an error if it couldn't set the group id to the one you want.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You can use user and group in place of uid and gid to have ps show you the group and user names instead of the numbers. And of course, if you have the process id, you don't need to browse the whole list ps -e gives you, but could just use something like this
$ ps -o pid,user,group,args -p "$pid"
or if you don't have the PID, pgrep could find it for you:
$ÃÂ ps -o pid,user,group,args -p $(pgrep -f app.sh)
But I do suspect sudo would give an error if it couldn't set the group id to the one you want.
You can use user and group in place of uid and gid to have ps show you the group and user names instead of the numbers. And of course, if you have the process id, you don't need to browse the whole list ps -e gives you, but could just use something like this
$ ps -o pid,user,group,args -p "$pid"
or if you don't have the PID, pgrep could find it for you:
$ÃÂ ps -o pid,user,group,args -p $(pgrep -f app.sh)
But I do suspect sudo would give an error if it couldn't set the group id to the one you want.
answered Dec 7 '17 at 21:30
ilkkachu
50.1k676138
50.1k676138
add a comment |Â
add a comment |Â
up vote
2
down vote
If you have the GID value, getent group $GID will give you back all details regarding group whose id is $ID including its name.
Alternatively you can also do getent group offline and see if the number you get back is the one you see in ps output.
I get a result saying offline:x:1003: what does the x mean here?
â natral
Dec 7 '17 at 21:30
It is a placeholder (for the group password, like user have passwords, groups can have too, but AFAIK this feature is nowhere used nowadays), so as long as you get a reply you are fine.
â Patrick Mevzek
Dec 7 '17 at 21:32
add a comment |Â
up vote
2
down vote
If you have the GID value, getent group $GID will give you back all details regarding group whose id is $ID including its name.
Alternatively you can also do getent group offline and see if the number you get back is the one you see in ps output.
I get a result saying offline:x:1003: what does the x mean here?
â natral
Dec 7 '17 at 21:30
It is a placeholder (for the group password, like user have passwords, groups can have too, but AFAIK this feature is nowhere used nowadays), so as long as you get a reply you are fine.
â Patrick Mevzek
Dec 7 '17 at 21:32
add a comment |Â
up vote
2
down vote
up vote
2
down vote
If you have the GID value, getent group $GID will give you back all details regarding group whose id is $ID including its name.
Alternatively you can also do getent group offline and see if the number you get back is the one you see in ps output.
If you have the GID value, getent group $GID will give you back all details regarding group whose id is $ID including its name.
Alternatively you can also do getent group offline and see if the number you get back is the one you see in ps output.
answered Dec 7 '17 at 21:21
Patrick Mevzek
2,0381721
2,0381721
I get a result saying offline:x:1003: what does the x mean here?
â natral
Dec 7 '17 at 21:30
It is a placeholder (for the group password, like user have passwords, groups can have too, but AFAIK this feature is nowhere used nowadays), so as long as you get a reply you are fine.
â Patrick Mevzek
Dec 7 '17 at 21:32
add a comment |Â
I get a result saying offline:x:1003: what does the x mean here?
â natral
Dec 7 '17 at 21:30
It is a placeholder (for the group password, like user have passwords, groups can have too, but AFAIK this feature is nowhere used nowadays), so as long as you get a reply you are fine.
â Patrick Mevzek
Dec 7 '17 at 21:32
I get a result saying offline:x:1003: what does the x mean here?
â natral
Dec 7 '17 at 21:30
I get a result saying offline:x:1003: what does the x mean here?
â natral
Dec 7 '17 at 21:30
It is a placeholder (for the group password, like user have passwords, groups can have too, but AFAIK this feature is nowhere used nowadays), so as long as you get a reply you are fine.
â Patrick Mevzek
Dec 7 '17 at 21:32
It is a placeholder (for the group password, like user have passwords, groups can have too, but AFAIK this feature is nowhere used nowadays), so as long as you get a reply you are fine.
â Patrick Mevzek
Dec 7 '17 at 21:32
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f409580%2fverify-group-of-process-was-set-correctly-when-launched%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password