Skip to content

Commit

Permalink
Debian patch: alling wait-for-database from pscheduler user instead of
Browse files Browse the repository at this point in the history
root.
  • Loading branch information
laeti-tia committed Feb 7, 2024
1 parent c2e410c commit c91c9f0
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/oneshot-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: oneshot-build
on: push
jobs:
setup-containers:
strategy:
#fail-fast: true
matrix:
os: [ 'el8' ]

runs-on: ubuntu-latest

container:
#image: ghcr.io/perfsonar/unibuild/${{ matrix.os }}:latest
options: --privileged
image: ghcr.io/perfsonar/docker-oneshot-builder/${{ matrix.os }}:latest
volumes:
- ${{ github.workspace }}:/build

steps:
- name: Check out Repo
uses: actions/checkout@v3
- name: install dep el7
if: ${{ matrix.os == 'el7' }}
run: yum -y install -y http://linux.mirrors.es.net/perfsonar/${{ matrix.os }}/x86_64/5/packages/perfsonar-repo-0.11-1.noarch.rpm
- name: install deps El8
if: ${{ matrix.os == 'el8' }}
run: dnf -y install -y http://linux.mirrors.es.net/perfsonar/${{ matrix.os }}/x86_64/5/packages/perfsonar-repo-0.11-1.noarch.rpm
- name: install deps EL9
if: ${{ matrix.os == 'el9' }}
run: dnf -y install -y http://linux.mirrors.es.net/perfsonar/${{ matrix.os }}/x86_64/5/packages/perfsonar-repo-0.11-1.noarch.rpm
- name: install deps d10
if: ${{ matrix.os == 'd10' }}
run: export DEBIAN_FRONTEND=noninteractive && curl -s http://downloads.perfsonar.net/debian/perfsonar-minor-snapshot.gpg.key | apt-key add - && curl -s -o /etc/apt/sources.list.d/perfsonar-minor-snapshot.list http://downloads.perfsonar.net/debian/perfsonar-minor-snapshot.list && apt-get update && echo && echo
- name: install deps d12
if: ${{ matrix.os == 'd12' }}
run: export DEBIAN_FRONTEND=noninteractive && curl -s http://downloads.perfsonar.net/debian/perfsonar-minor-snapshot.gpg.key | apt-key add - && curl -s -o /etc/apt/sources.list.d/perfsonar-minor-snapshot.list http://downloads.perfsonar.net/debian/perfsonar-minor-snapshot.list && apt-get update && echo && echo
- name: install deps u18
if: ${{ matrix.os == 'u18' }}
run: export DEBIAN_FRONTEND=noninteractive && curl -s http://downloads.perfsonar.net/debian/perfsonar-minor-snapshot.gpg.key | apt-key add - && curl -s -o /etc/apt/sources.list.d/perfsonar-minor-snapshot.list http://downloads.perfsonar.net/debian/perfsonar-minor-snapshot.list && apt-get update && echo && echo
- name: install deps u20
if: ${{ matrix.os == 'u20' }}
run: export DEBIAN_FRONTEND=noninteractive && curl -s http://downloads.perfsonar.net/debian/perfsonar-minor-snapshot.gpg.key | apt-key add - && curl -s -o /etc/apt/sources.list.d/perfsonar-minor-snapshot.list http://downloads.perfsonar.net/debian/perfsonar-minor-snapshot.list && apt-get update && echo && echo

- name: build
run: make
- name: tar files
run: tar -cvf pscheduler.tar *

- name: Archive repo
uses: actions/upload-artifact@v3
with:
name: pscheduler-${{ matrix.os }}.tar
path: pscheduler.tar
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ reset.patch
backup.patch
db-udpate.patch
db-change-password.patch
services
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Index: b/daemons/service-template.m4
===================================================================
--- a/daemons/service-template.m4 2024-02-07 15:37:06.675678909 +0100
+++ b/daemons/service-template.m4 2024-02-07 18:05:28.998039367 +0100
@@ -45,7 +45,7 @@
# Wait for the database to become accessible. This is done because
# the PostgreSQL service can appear up when it isn't ready to take
# queries yet. That will cause this service to die.
-ExecStartPre=__DAEMONDIR__/wait-for-database --dsn @__DSN__ --dwell 120 --retry 5
+ExecStartPre=sudo -u pscheduler __DAEMONDIR__/wait-for-database --dsn @__DSN__ --dwell 120 --retry 5

# Create the run directory
ExecStartPre=/bin/mkdir -p __RUNDIR__/__PROG__

0 comments on commit c91c9f0

Please sign in to comment.