All of lore.kernel.org
 help / color / mirror / Atom feed
* How to add user with nologin shell
@ 2016-11-24 10:05 Bipnesh, Abhinav (Abhinav)
  2016-11-24 10:22 ` Michel D'HOOGE
  0 siblings, 1 reply; 4+ messages in thread
From: Bipnesh, Abhinav (Abhinav) @ 2016-11-24 10:05 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

Hi,

I am trying to add an user to image with /sbin/nologin but it fails with below error

WARNING: avaya-image: useradd command did not succeed. Retrying...
ERROR: test-image: Tried running useradd command 1 times without success, giving up
ERROR: Function failed: set_user_group (log file is located at /home/abhinav/bitbake/.../test-image/1.0-r0/temp/log.do_rootfs.54725)
ERROR: Logfile of failure stored in: /home/abhinav/bitbake/../test-image/1.0-r0/temp/log.do_rootfs.54725
ERROR: Task 7 (/home/abhinav/bitbake/../images/test-image.bb, do_rootfs) failed with exit code '1'

I am using below section in my recipe to achieve it
EXTRA_USERS_PARAMS = "useradd -M -g user1 user1 -r -s /sbin/nologin;"

Any thoughts how to fix it.

Thanks,
Abhinav

[-- Attachment #2: Type: text/html, Size: 2959 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to add user with nologin shell
  2016-11-24 10:05 How to add user with nologin shell Bipnesh, Abhinav (Abhinav)
@ 2016-11-24 10:22 ` Michel D'HOOGE
  2016-11-24 12:36   ` Bipnesh, Abhinav (Abhinav)
  0 siblings, 1 reply; 4+ messages in thread
From: Michel D'HOOGE @ 2016-11-24 10:22 UTC (permalink / raw)
  To: yocto

Hi, 

> From: "Abhinav Bipnesh (Abhinav)" <abhinavbipnesh@avaya.com>
> Sent: Thursday, 24 November, 2016 11:05:59 AM

> I am trying to add an user to image with /sbin/nologin but it fails
> with below error


> ERROR: Function failed: set_user_group (log file is located at
> /home/abhinav/bitbake/…/test-image/1.0-r0/temp/log.do_rootfs.54725)

The problem seems to be with the group.
According to my man page, the group must already exist.

> I am using below section in my recipe to achieve it
> EXTRA_USERS_PARAMS = “useradd -M -g user1 user1 -r -s /sbin/nologin;”

Why don't you use the -U flag?

Michel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to add user with nologin shell
  2016-11-24 10:22 ` Michel D'HOOGE
@ 2016-11-24 12:36   ` Bipnesh, Abhinav (Abhinav)
  2016-11-24 12:56     ` Michel D'HOOGE
  0 siblings, 1 reply; 4+ messages in thread
From: Bipnesh, Abhinav (Abhinav) @ 2016-11-24 12:36 UTC (permalink / raw)
  To: Michel D'HOOGE, yocto

Hi,

Still same error even if I used -U option.

I tried even groupadd but still I get below error.

So any thoughts to fix it.

Thanks,
Abhinav

-----Original Message-----
From: yocto-bounces@yoctoproject.org [mailto:yocto-bounces@yoctoproject.org] On Behalf Of Michel D'HOOGE
Sent: Thursday, November 24, 2016 15:52
To: yocto@yoctoproject.org
Subject: Re: [yocto] How to add user with nologin shell

Hi, 

> From: "Abhinav Bipnesh (Abhinav)" <abhinavbipnesh@avaya.com>
> Sent: Thursday, 24 November, 2016 11:05:59 AM

> I am trying to add an user to image with /sbin/nologin but it fails 
> with below error


> ERROR: Function failed: set_user_group (log file is located at
> /home/abhinav/bitbake/…/test-image/1.0-r0/temp/log.do_rootfs.54725)

The problem seems to be with the group.
According to my man page, the group must already exist.

> I am using below section in my recipe to achieve it EXTRA_USERS_PARAMS 
> = “useradd -M -g user1 user1 -r -s /sbin/nologin;”

Why don't you use the -U flag?

Michel
--
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.yoctoproject.org_listinfo_yocto&d=DQIGaQ&c=BFpWQw8bsuKpl1SgiZH64Q&r=geJ1wB7xRIMmteYB2Fo8esL32BOWvwP1HmY0YuLEB4E&m=sR9QTHBLoNC-ypErmIN_NOajUJyBVe5kWfwE32I43Lk&s=V6K3KI5p4m71vEg5maFLO2bQc4Uymrj_t1oh5H466Eg&e= 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to add user with nologin shell
  2016-11-24 12:36   ` Bipnesh, Abhinav (Abhinav)
@ 2016-11-24 12:56     ` Michel D'HOOGE
  0 siblings, 0 replies; 4+ messages in thread
From: Michel D'HOOGE @ 2016-11-24 12:56 UTC (permalink / raw)
  To: yocto

> Still same error even if I used -U option.
> 
> I tried even groupadd but still I get below error.

Can you try this:
EXTRA_USERS_PARAMS = "useradd -r -s /sbin/nologin user1;"

According to my man page:
  By default, a group will also be created for the new user
  <username> must be last
  -r also implies -M

Michel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-24 12:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-24 10:05 How to add user with nologin shell Bipnesh, Abhinav (Abhinav)
2016-11-24 10:22 ` Michel D'HOOGE
2016-11-24 12:36   ` Bipnesh, Abhinav (Abhinav)
2016-11-24 12:56     ` Michel D'HOOGE

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.