Skip to content

Commit

Permalink
Packaging: create pelican user and group and some directories for it
Browse files Browse the repository at this point in the history
Part of #1851 ; this creates
a system user and group named `pelican`; it also pre-creates some directories
that Pelican won't be able to create after dropping privs to the `pelican`
user.
  • Loading branch information
matyasselmeci committed Dec 26, 2024
1 parent 21c426d commit 91ac9f1
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ nfpms:
release: 1
section: default
priority: extra
scripts:
preinstall: "scripts/preinstall.sh"
overrides:
rpm:
contents:
Expand All @@ -147,6 +149,24 @@ nfpms:
mode: 0755
owner: root
group: root
- dst: "/var/lib/pelican"
type: dir
file_info:
mode: 0755
owner: pelican
group: pelican
- dst: "/var/lib/pelican/monitoring"
type: dir
file_info:
mode: 0755
owner: pelican
group: pelican
- dst: "/var/spool/pelican"
type: dir
file_info:
mode: 0755
owner: pelican
group: pelican
deb:
contents:
- src: LICENSE
Expand All @@ -165,6 +185,24 @@ nfpms:
mode: 0755
owner: root
group: root
- dst: "/var/lib/pelican"
type: dir
file_info:
mode: 0755
owner: pelican
group: pelican
- dst: "/var/lib/pelican/monitoring"
type: dir
file_info:
mode: 0755
owner: pelican
group: pelican
- dst: "/var/spool/pelican"
type: dir
file_info:
mode: 0755
owner: pelican
group: pelican
apk:
contents:
- src: LICENSE
Expand All @@ -183,6 +221,24 @@ nfpms:
mode: 0755
owner: root
group: root
- dst: "/var/lib/pelican"
type: dir
file_info:
mode: 0755
owner: pelican
group: pelican
- dst: "/var/lib/pelican/monitoring"
type: dir
file_info:
mode: 0755
owner: pelican
group: pelican
- dst: "/var/spool/pelican"
type: dir
file_info:
mode: 0755
owner: pelican
group: pelican
# end package pelican

- package_name: pelican-osdf-compat
Expand Down
6 changes: 6 additions & 0 deletions scripts/preinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

getent group pelican >/dev/null || groupadd -r pelican
getent passwd pelican >/dev/null || \
useradd -r -g pelican -c "Pelican service user" \
-s /sbin/nologin -d /var/lib/pelican pelican

0 comments on commit 91ac9f1

Please sign in to comment.