Skip to content

Commit

Permalink
fix pre and post scripts to correctly create and delete the user
Browse files Browse the repository at this point in the history
  • Loading branch information
schlomo committed Sep 27, 2012
1 parent f18e255 commit 34dd519
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
Binary file removed out/kiosk-browser_1.11_all.deb
Binary file not shown.
Binary file added out/kiosk-browser_1.12_all.deb
Binary file not shown.
2 changes: 1 addition & 1 deletion src/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: kiosk-browser
Version: 1.11
Version: 1.12
Priority: optional
Section: universe/web
Architecture: all
Expand Down
5 changes: 3 additions & 2 deletions src/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
set -e

if ! getent passwd kiosk-browser >/dev/null; then
adduser --disabled-password --gecos "Kiosk Browser User" --firstuid 200 --lastuid 300 --home /var/lib/kiosk-browser kiosk-browser
useradd --system --user-group --comment "Kiosk Browser User" --no-create-home --home-dir /var/lib/kiosk-browser kiosk-browser
mkdir -p /var/lib/kiosk-browser
fi

# disable lightdm and enable nodm
echo "/usr/sbin/nodm" >/etc/X11/default-display-manager
# disable X cursor
sed -i -e 's/NODM_X_OPTIONS=.*/NODM_X_OPTIONS="-nocursor -nolisten tcp"/' -e 's/NODM_ENABLED=.*/NODM_ENABLED=true/' -e 's/NODM_USER=.*/NODM_USER=kiosk-browser/' /etc/default/nodm

# allow kiosk user to only write in chromium directories
# allow kiosk user to only write in directories needed by chromium
mkdir -p /var/lib/kiosk-browser/{.cache,.config/chromium,.pki}
chown -R kiosk-browser:kiosk-browser /var/lib/kiosk-browser/{.cache,.config/chromium,.pki}
6 changes: 2 additions & 4 deletions src/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/sh
set -e

if getent passwd kiosk-browser-g >/dev/null; then
if [ -x /usr/sbin/deluser ]; then
deluser --remove-home kiosk-browser || echo "Could not remove kiosk-browser user."
fi
if getent passwd kiosk-browser >/dev/null; then
userdel --force --remove kiosk-browser || echo "Could not remove kiosk-browser user."
fi

0 comments on commit 34dd519

Please sign in to comment.