Skip to content

Commit f5ec1dc

Browse files
authored
use consistent users/groups on rhel/debian (#730)
1 parent bbae0b4 commit f5ec1dc

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

debian/python3-patchman.postinst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ if [ "$1" = "configure" ] ; then
2222
patchman-manage migrate --run-syncdb --fake-initial
2323
sqlite3 /var/lib/patchman/db/patchman.db 'PRAGMA journal_mode=WAL;'
2424

25-
chown -R www-data:www-data /var/lib/patchman
26-
adduser --system --group patchman-celery
27-
usermod -a -G www-data patchman-celery
28-
chown root:patchman-celery /etc/patchman/celery.conf
25+
adduser --quiet --system --group patchman
26+
adduser --quiet www-data patchman
27+
chown root:patchman /etc/patchman/celery.conf
2928
chmod 640 /etc/patchman/celery.conf
3029
chmod g+w /var/lib/patchman /var/lib/patchman/db /var/lib/patchman/db/patchman.db
30+
chown -R patchman:patchman /var/lib/patchman
3131

3232
WORKER_COUNT=1
3333
if [ -f /etc/patchman/celery.conf ]; then

etc/systemd/system/patchman-celery-beat.service

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ After=network-online.target
55

66
[Service]
77
Type=simple
8-
User=patchman-celery
9-
Group=patchman-celery
8+
User=patchman
9+
Group=patchman
1010
Environment="REDIS_HOST=127.0.0.1"
1111
Environment="REDIS_PORT=6379"
1212
EnvironmentFile=/etc/patchman/celery.conf

etc/systemd/system/patchman-celery-worker.service

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ After=network-online.target
55

66
[Service]
77
Type=simple
8-
User=patchman-celery
9-
Group=patchman-celery
8+
User=patchman
9+
Group=patchman
1010
Environment="REDIS_HOST=127.0.0.1"
1111
Environment="REDIS_PORT=6379"
1212
Environment="CELERY_POOL_TYPE=solo"

scripts/rpm-post-install.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ patchman-manage makemigrations
2525
patchman-manage migrate --run-syncdb --fake-initial
2626
sqlite3 /var/lib/patchman/db/patchman.db 'PRAGMA journal_mode=WAL;'
2727

28-
adduser --system --group patchman-celery
29-
usermod -a -G apache patchman-celery
30-
chown root:patchman-celery /etc/patchman/celery.conf
28+
adduser --system --shell /sbin/nologin patchman
29+
usermod -a -G patchman apache
30+
chown root:patchman /etc/patchman/celery.conf
3131
chmod 640 /etc/patchman/celery.conf
32-
33-
chown -R apache:apache /var/lib/patchman
32+
chown -R patchman:patchman /var/lib/patchman
3433
semanage fcontext -a -t httpd_sys_rw_content_t "/var/lib/patchman/db(/.*)?"
3534
restorecon -Rv /var/lib/patchman/db
36-
setsebool -P httpd_can_network_memcache 1
3735
setsebool -P httpd_can_network_connect 1
3836

3937
WORKER_COUNT=1

0 commit comments

Comments
 (0)