core.host.adduser ignores shell when creating a system user

Bug #2071500 reported by Adithya Rajendran
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers
New
Undecided
Unassigned

Bug Description

When trying to create a system user with shell='/usr/sbin/nologin', the user is created with the shell `/bin/sh` instead. core.host.adduser ignores shell when creating a system user.

```
adduser("test123", shell="/usr/sbin/nologin", system_user=True, primary_group="test123", home_dir="/tmp/test123")

cat /etc/passwd
test123:x:995:128::/home/test123:/bin/sh
```

Issue can be observed in mysql-router charm https://bugs.launchpad.net/charm-mysql-router/+bug/2060644

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.