Merge lp:~sergiusens/snappy/usersCreate into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by Sergio Schvezov
Status: Merged
Approved by: Michael Vogt
Approved revision: 326
Merged at revision: 326
Proposed branch: lp:~sergiusens/snappy/usersCreate
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 14 lines (+10/-0)
1 file modified
debian/ubuntu-snappy-cli.postinst (+10/-0)
To merge this branch: bzr merge lp:~sergiusens/snappy/usersCreate
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Review via email: mp+255644@code.launchpad.net

Commit message

Create clickpkg user/group in case it doesn't exist in postinst of ubuntu-snappy-cli

Description of the change

According to https://wiki.debian.org/AccountHandlingInMaintainerScripts

"It should normally not be necessary to cross-check with getent whether an account already exists since adduser --system generally does the right thing. If not, please report a bug against adduser to keep your maintainer scripts simple."

Thus:
sergiusens@lothlorien:~/go/src/launchpad.net/snappy$ sudo adduser --system --disabled-password --home /nonexistent --no-create-home --group clickpkg
Warning: The home dir /nonexistent you specified can't be accessed: No such file or directory
Adding system user `clickpkg' (UID 116) ...
Adding new group `clickpkg' (GID 126) ...
Adding new user `clickpkg' (UID 116) with group `clickpkg' ...
Not creating home directory `/nonexistent'.
sergiusens@lothlorien:~/go/src/launchpad.net/snappy$ sudo adduser --system --disabled-password --home /nonexistent --no-create-home --group clickpkg
Warning: The home dir /nonexistent you specified can't be accessed: No such file or directory
The system user `clickpkg' already exists. Exiting.
sergiusens@lothlorien:~/go/src/launchpad.net/snappy$ echo $?
0

FTR, I took --home /nonexistent from whoopsie's postinst

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'debian/ubuntu-snappy-cli.postinst'
2--- debian/ubuntu-snappy-cli.postinst 1970-01-01 00:00:00 +0000
3+++ debian/ubuntu-snappy-cli.postinst 2015-04-09 11:40:57 +0000
4@@ -0,0 +1,10 @@
5+#!/bin/sh
6+
7+if [ "$1" = configure ]; then
8+ adduser --system \
9+ --disabled-password \
10+ --home /nonexistent \
11+ --no-create-home \
12+ --group \
13+ clickpkg
14+fi

Subscribers

People subscribed via source and target branches