fix: change doas with (proper) command_user
explaination: https://www.redhat.com/en/blog/sudo-rootless-podman
This commit is contained in:
parent
8f31873ceb
commit
670dd1fc85
1 changed files with 5 additions and 3 deletions
|
|
@ -14,7 +14,9 @@ command="$PODMAN"
|
|||
command_args="start --all --filter restart-policy=always"
|
||||
name="podman-containers"
|
||||
command_background=true
|
||||
command_user=hane
|
||||
pidfile="/var/run/${RC_SVCNAME}.pid"
|
||||
#pidfile="/tmp/xdg/$UID-xdg-runtime-dir/${RC_SVCNAME}.pid"
|
||||
output_log="/home/${CONTAINER_USER:-$DEFAULT_CONTAINER_USER}/pihanepi/orchestrating/${RC_SVCNAME}.log"
|
||||
error_log="/home/${CONTAINER_USER:-$DEFAULT_CONTAINER_USER}/pihanepi/orchestrating/${RC_SVCNAME}.err"
|
||||
|
||||
|
|
@ -25,18 +27,18 @@ error_log="/home/${CONTAINER_USER:-$DEFAULT_CONTAINER_USER}/pihanepi/orchestrati
|
|||
|
||||
start() {
|
||||
ebegin "Starting Podman containers with restart policy"
|
||||
doas -u "$CONTAINER_USER" "$PODMAN" start --all --filter restart-policy=$RESTART_POLICY
|
||||
"$PODMAN" start --all --filter restart-policy=$RESTART_POLICY
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping Podman containers with restart policy"
|
||||
|
||||
CONTAINERS=$(doas -u "$CONTAINER_USER" "$PODMAN" container ls --filter restart-policy=$RESTART_POLICY -q)
|
||||
CONTAINERS=$("$PODMAN" container ls --filter restart-policy=$RESTART_POLICY -q)
|
||||
|
||||
if [ -n "$CONTAINERS" ]; then
|
||||
for CONTAINER in $CONTAINERS; do
|
||||
doas -u "$CONTAINER_USER" "$PODMAN" stop "$CONTAINER"
|
||||
"$PODMAN" stop "$CONTAINER"
|
||||
done
|
||||
eend $?
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue